mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Teach witness repmgrd to deal with the absence of a primary
Previously it would refuse to start if the primary was not reachable, the thinking being that it's pointless trying to monitor an incomplete cluster. However following an aborted failover situation, repmgrd will restart monitoring and on the witness server, this will lead to it aborting itself due to to continuing absence of primary. To resolve this, witness repmgrd will now start monitoring in degraded mode if no primary is found in the hope a primary will reappear at some point.
This commit is contained in:
@@ -4709,6 +4709,13 @@ get_new_primary(PGconn *conn, int *primary_node_id)
|
||||
|
||||
PQclear(res);
|
||||
|
||||
/*
|
||||
* repmgr.get_new_primary() will return UNKNOWN_NODE_ID if
|
||||
* "follow_new_primary" is false
|
||||
*/
|
||||
if (new_primary_node_id == UNKNOWN_NODE_ID)
|
||||
success = false;
|
||||
|
||||
*primary_node_id = new_primary_node_id;
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user