mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
repmgrd: fix failover handling in "manual" mode
Regression was introduced in commit c7a585c555
This commit is contained in:
@@ -1483,7 +1483,7 @@ do_primary_failover(void)
|
|||||||
|
|
||||||
failover_state = promote_self();
|
failover_state = promote_self();
|
||||||
}
|
}
|
||||||
else if (election_result == ELECTION_LOST)
|
else if (election_result == ELECTION_LOST || election_result == ELECTION_NOT_CANDIDATE)
|
||||||
{
|
{
|
||||||
log_info(_("follower node awaiting notification from the candidate node"));
|
log_info(_("follower node awaiting notification from the candidate node"));
|
||||||
failover_state = FAILOVER_STATE_WAITING_NEW_PRIMARY;
|
failover_state = FAILOVER_STATE_WAITING_NEW_PRIMARY;
|
||||||
@@ -1499,7 +1499,7 @@ do_primary_failover(void)
|
|||||||
|
|
||||||
/* TODO: rerun election if new primary doesn't appear after timeout */
|
/* TODO: rerun election if new primary doesn't appear after timeout */
|
||||||
|
|
||||||
/* either follow or time out; either way resume monitoring */
|
/* either follow, self-promote or time out; either way resume monitoring */
|
||||||
if (wait_primary_notification(&new_primary_id) == true)
|
if (wait_primary_notification(&new_primary_id) == true)
|
||||||
{
|
{
|
||||||
/* if primary has reappeared, no action needed */
|
/* if primary has reappeared, no action needed */
|
||||||
@@ -1550,11 +1550,9 @@ do_primary_failover(void)
|
|||||||
&config_file_options,
|
&config_file_options,
|
||||||
local_node_info.node_id,
|
local_node_info.node_id,
|
||||||
"standby_disconnect_manual",
|
"standby_disconnect_manual",
|
||||||
|
/*
|
||||||
/*
|
* here "true" indicates the action has occurred as expected
|
||||||
* here "true" indicates the action has occurred as
|
*/
|
||||||
* expected
|
|
||||||
*/
|
|
||||||
true,
|
true,
|
||||||
event_details.data);
|
event_details.data);
|
||||||
PQfinish(new_primary_conn);
|
PQfinish(new_primary_conn);
|
||||||
|
|||||||
Reference in New Issue
Block a user