Add "repmgr standby follow --upstream-node-id"

In an automatic failover situation, after a standby has been promoted
there's a risk the original primary may become available again before
"standby follow" is issued on another standby node, in which case "standby
follow" will reconnect to the original primary.

As the standby's repmgrd will have received a notification from the new
primary, it will know the primary's ID and can therefore explicitly
direct "standby follow" to follow that primary.
This commit is contained in:
Ian Barwick
2017-09-04 09:11:59 +09:00
parent 3aeceab081
commit 47a4b49890
3 changed files with 61 additions and 18 deletions

View File

@@ -65,9 +65,11 @@ typedef struct
char recovery_min_apply_delay[MAXLEN];
char replication_user[MAXLEN];
char upstream_conninfo[MAXLEN];
int upstream_node_id;
bool without_barman;
/* "standby clone"/"standby follow" options */
int upstream_node_id;
/* "standby register" options */
bool wait_register_sync;
int wait_register_sync_seconds;
@@ -123,7 +125,9 @@ typedef struct
UNKNOWN_NODE_ID, "", "", \
/* "standby clone" options */ \
false, CONFIG_FILE_SAMEPATH, false, false, false, "", "", "", \
NO_UPSTREAM_NODE, false, \
false, \
/* "standby clone"/"standby follow" options */ \
NO_UPSTREAM_NODE, \
/* "standby register" options */ \
false, 0, \
/* "standby switchover" options */ \