From 088ca29fe3267a480684e3eb482db522c10d5817 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Mon, 3 Dec 2012 09:18:08 -0500 Subject: [PATCH] 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. --- repmgrd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repmgrd.c b/repmgrd.c index 24d612a9..96e5ea81 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -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) {