mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
To select new master it needs to know which standby has received more
xlog records from master, so it standby should use pg_last_xlog_receive_location() to report their positions. This solves a possible situation in which a standby that is considered as new master when promoted is no longer the best option.
This commit is contained in:
@@ -596,7 +596,7 @@ do_failover(void)
|
||||
nodeInfo best_candidate = {-1, InvalidXLogRecPtr, false };
|
||||
|
||||
/* first we get info about this node, and update shared memory */
|
||||
sprintf(sqlquery, "SELECT pg_last_xlog_replay_location()");
|
||||
sprintf(sqlquery, "SELECT pg_last_xlog_receive_location()");
|
||||
res1 = PQexec(myLocalConn, sqlquery);
|
||||
if (PQresultStatus(res1) != PGRES_TUPLES_OK)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user