mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Add configuration option "primary_visibility_consensus"
This determines whether repmgrd should continue with a failover if one or more nodes report they can still see the standby.
This commit is contained in:
@@ -3526,20 +3526,24 @@ do_election(void)
|
||||
|
||||
if (nodes_with_primary_still_visible > 0)
|
||||
{
|
||||
log_notice(_("%i nodes can see the primary"),
|
||||
log_info(_("%i nodes can see the primary"),
|
||||
nodes_with_primary_still_visible);
|
||||
|
||||
log_detail(_("following nodes can see the primary:\n%s"),
|
||||
nodes_with_primary_visible.data);
|
||||
|
||||
monitoring_state = MS_DEGRADED;
|
||||
INSTR_TIME_SET_CURRENT(degraded_monitoring_start);
|
||||
if (config_file_options.primary_visibility_consensus == true)
|
||||
{
|
||||
log_notice(_("cancelling failover as some nodes can still see the primary"));
|
||||
monitoring_state = MS_DEGRADED;
|
||||
INSTR_TIME_SET_CURRENT(degraded_monitoring_start);
|
||||
|
||||
reset_node_voting_status();
|
||||
reset_node_voting_status();
|
||||
|
||||
termPQExpBuffer(&nodes_with_primary_visible);
|
||||
termPQExpBuffer(&nodes_with_primary_visible);
|
||||
|
||||
return ELECTION_CANCELLED;
|
||||
return ELECTION_CANCELLED;
|
||||
}
|
||||
}
|
||||
|
||||
termPQExpBuffer(&nodes_with_primary_visible);
|
||||
|
||||
Reference in New Issue
Block a user