repmgrd: improve primary visibility consensus check

Exclude sibling nodes which report they're following a different
node. This shouldn't happen, but could.
This commit is contained in:
Ian Barwick
2019-04-04 16:03:55 +09:00
parent 008bd00a59
commit cd6a55c7cb
4 changed files with 32 additions and 16 deletions

View File

@@ -436,10 +436,6 @@ get_upstream_node_id(PG_FUNCTION_ARGS)
if (!shared_state)
PG_RETURN_NULL();
/* A primary node cannot have an upstream ID */
if (!RecoveryInProgress())
PG_RETURN_INT32(UNKNOWN_NODE_ID);
LWLockAcquire(shared_state->lock, LW_SHARED);
upstream_node_id = shared_state->upstream_node_id;
LWLockRelease(shared_state->lock);