repmgr: standby register --wait-sync=0 can loop infinitely

This commit is contained in:
Ian Barwick
2016-12-23 11:29:19 +09:00
parent 8f3f4eb4a3
commit e88a8a9708
2 changed files with 10 additions and 4 deletions

View File

@@ -2296,7 +2296,9 @@ do_standby_register(void)
/* if --wait-sync option set, wait for the records to synchronise */
if (PQstatus(conn) == CONNECTION_OK && runtime_options.wait_register_sync)
if (PQstatus(conn) == CONNECTION_OK &&
runtime_options.wait_register_sync == true &&
runtime_options.wait_register_sync_seconds > 0)
{
bool sync_ok = false;
int timer = 0;

View File

@@ -113,13 +113,15 @@ typedef struct
bool no_conninfo_password;
bool copy_external_config_files;
int copy_external_config_files_destination;
bool wait_register_sync;
int wait_register_sync_seconds;
char upstream_conninfo[MAXLEN];
char replication_user[MAXLEN];
char recovery_min_apply_delay[MAXLEN];
/* standby register paarameters */
bool wait_register_sync;
int wait_register_sync_seconds;
/* witness create parameters */
bool witness_pwprompt;
@@ -156,7 +158,9 @@ typedef struct
false, false, false, \
/* standby clone parameters */ \
false, DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, false, false, \
false, CONFIG_FILE_SAMEPATH, false, 0, "", "", "", \
false, CONFIG_FILE_SAMEPATH, "", "", "", \
/* standby register paarameters */ \
false, 0, \
/* witness create parameters */ \
false, \
/* standby follow parameters */ \