repmgrd: during failover, check if other nodes have seen the primary

In a situation where only some standbys are cut off from the primary,
a failover would result in a split brain/split cluster situation,
as it's likely one of the cut-off standbys will promote itself, and
other cut-off standbys (but not all standbys) will follow it.

To prevent this happening, interrogate the other sibiling nodes to
check whether they've seen the primary within a reasonably short interval;
if this is the case, do not take any failover action.

This feature is experimental.
This commit is contained in:
Ian Barwick
2019-02-23 12:59:08 +09:00
parent 07097575b1
commit b72c894db4
3 changed files with 50 additions and 6 deletions

View File

@@ -308,6 +308,7 @@ typedef struct
int replication_lag_time;
bool receiving_streamed_wal;
bool wal_replay_paused;
int primary_last_seen;
} ReplInfo;
typedef struct