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;