"standby switchover": check demotion candidate can make replication connection

Check it's actually possible for the demotion candidate to attach to
the promotion candidate before executing the switchover.

As with other checks of this nature, there's a faint possibility the
situation could change between the time the check is carried out and
the demotion candidate is restarted to connect to the promotion candidate,
but there's not a lot we can do about that. The main purpose is to
be able to catch existing misconfigurations before anything gets changed.

Implements GitHub #370.
This commit is contained in:
Ian Barwick
2018-02-08 16:59:30 +09:00
committed by Ian Barwick
parent 76a93af15c
commit 927bf038a0
6 changed files with 205 additions and 14 deletions

View File

@@ -68,6 +68,7 @@ typedef struct
int node_id;
char node_name[MAXLEN];
char data_dir[MAXPGPATH];
int remote_node_id;
/* "standby clone" options */
bool copy_external_config_files;
@@ -103,6 +104,7 @@ typedef struct
bool role;
bool slots;
bool has_passfile;
bool replication_connection;
/* "node join" options */
char config_files[MAXLEN];
@@ -139,8 +141,8 @@ typedef struct
"", "", "", "", \
/* other connection options */ \
"", "", \
/* node options */ \
UNKNOWN_NODE_ID, "", "", \
/* general node options */ \
UNKNOWN_NODE_ID, "", "", UNKNOWN_NODE_ID, \
/* "standby clone" options */ \
false, CONFIG_FILE_SAMEPATH, false, false, false, "", "", "", \
false, \
@@ -153,7 +155,7 @@ typedef struct
/* "node status" options */ \
false, \
/* "node check" options */ \
false, false, false, false, false, false, \
false, false, false, false, false, false, false, \
/* "node join" options */ \
"", \
/* "node service" options */ \