diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c index c399128b..2e44e983 100644 --- a/src/watchdog/wd_lifecheck.c +++ b/src/watchdog/wd_lifecheck.c @@ -421,10 +421,20 @@ lifecheck_main(void) wd_initialize_trusted_servers_list(); - /* wait until ready to go */ - while (WD_OK != is_wd_lifecheck_ready()) + /* + * we do not want to mark remote node(s) as dead too early + * during statup. + */ + if (WD_OK != is_wd_lifecheck_ready()) { - sleep(pool_config->wd_interval * 10); + int wait_sec = pool_config->wd_interval; + if (pool_config->wd_lifecheck_method == LIFECHECK_BY_HB) + { + if (pool_config->wd_heartbeat_deadtime > pool_config->wd_interval) + wait_sec = pool_config->wd_heartbeat_deadtime; + } + /* wait twice the configured interval */ + sleep(wait_sec * 2); } ereport(LOG,