mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 15:16:29 +00:00
Witness server should always try to re-connect to primary
Standbys will try to reconnect even in MANUAL_FAILOVER mode, so it's consistent to have the witness server do that too.
This commit is contained in:
12
repmgrd.c
12
repmgrd.c
@@ -473,8 +473,12 @@ main(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* witness_monitor()
|
||||
*
|
||||
* Monitors witness server; attempt to find and connect to new primary
|
||||
* if existing primary connection is lost
|
||||
*/
|
||||
static void
|
||||
witness_monitor(void)
|
||||
@@ -485,15 +489,15 @@ witness_monitor(void)
|
||||
bool connection_ok;
|
||||
|
||||
/*
|
||||
* Check if master is available;
|
||||
* if not, assume failover situation and try to determie new master
|
||||
* ZZZ only if `AUTOMATIC_FAILOVER` set???
|
||||
* Check if master is available; if not, assume failover situation
|
||||
* and try to determine new master. There may be a delay between detection
|
||||
* of a missing master and promotion of a standby by that standby's
|
||||
* rempgrd, so we'll loop for a while before giving up.
|
||||
*/
|
||||
connection_ok = check_connection(primary_conn, "master");
|
||||
|
||||
if(connection_ok == FALSE)
|
||||
{
|
||||
|
||||
log_debug(_("Old primary node ID: %i\n"), primary_options.node);
|
||||
/* We need to wait a while for the new primary to be promoted */
|
||||
// ZZZ loop here `local_options.reconnect_attempts` times
|
||||
|
||||
Reference in New Issue
Block a user