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:
Jaime Casanova
2012-12-03 09:18:08 -05:00
parent 30e9d06172
commit 088ca29fe3

View File

@@ -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)
{