mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
repmgrd: handle failover with two nodes in the primary location
If two nodes were in the primary location, and at least one node in another location, the non-failed node in the primary location was not recognising itself as a promotion candidate. Addresses GitHub #407.
This commit is contained in:
2
HISTORY
2
HISTORY
@@ -4,6 +4,8 @@
|
|||||||
repmgr: poll demoted primary after restart as a standby during a
|
repmgr: poll demoted primary after restart as a standby during a
|
||||||
switchover operation; GitHub #408 (Ian)
|
switchover operation; GitHub #408 (Ian)
|
||||||
repmgrd: fix memory leaks in witness code (AndrzejNowicki, Martín)
|
repmgrd: fix memory leaks in witness code (AndrzejNowicki, Martín)
|
||||||
|
repmgrd: handle failover situation with only two nodes in the primary
|
||||||
|
location, and at least one node in another location; GitHub #407 (Ian)
|
||||||
repmgrd: set "connect_timeout=2" when pinging a server (Ian)
|
repmgrd: set "connect_timeout=2" when pinging a server (Ian)
|
||||||
|
|
||||||
4.0.4 2018-03-09
|
4.0.4 2018-03-09
|
||||||
|
|||||||
@@ -2554,6 +2554,14 @@ do_election(void)
|
|||||||
return ELECTION_NOT_CANDIDATE;
|
return ELECTION_NOT_CANDIDATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* standby nodes found - check if we're in the primary location befor checking theirs */
|
||||||
|
if (strncmp(upstream_node_info.location, local_node_info.location, MAXLEN) == 0)
|
||||||
|
{
|
||||||
|
primary_location_seen = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* get our lsn */
|
/* get our lsn */
|
||||||
local_node_info.last_wal_receive_lsn = get_last_wal_receive_location(local_conn);
|
local_node_info.last_wal_receive_lsn = get_last_wal_receive_location(local_conn);
|
||||||
|
|||||||
Reference in New Issue
Block a user