From 9d03d4a254a55c49d7c91bef78ddf38363136645 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Thu, 1 Dec 2011 23:58:12 -0500 Subject: [PATCH] After checking that master is alive, is_pgup() should return not keep checking forever. --- dbutils.c | 3 ++- repmgrd.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dbutils.c b/dbutils.c index 5cdac381..7ccca6fb 100644 --- a/dbutils.c +++ b/dbutils.c @@ -160,7 +160,7 @@ is_pgup(PGconn *conn, int timeout) if (wait_connection_availability(conn, timeout) != 1) goto failed; - continue; + break; failed: // we need to retry, because we might just have loose the connection once @@ -170,6 +170,7 @@ failed: twice = true; } } + return true; } diff --git a/repmgrd.c b/repmgrd.c index 5a01b0da..467b732a 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -388,6 +388,7 @@ WitnessMonitor(void) * Execute the query asynchronously, but don't check for a result. We * will check the result next time we pause for a monitor step. */ + log_debug("WitnessMonitor: %s\n", sqlquery); if (PQsendQuery(primaryConn, sqlquery) == 0) log_warning(_("Query could not be sent to primary. %s\n"), PQerrorMessage(primaryConn)); @@ -532,6 +533,7 @@ StandbyMonitor(void) * Execute the query asynchronously, but don't check for a result. We * will check the result next time we pause for a monitor step. */ + log_debug("StandbyMonitor: %s\n", sqlquery); if (PQsendQuery(primaryConn, sqlquery) == 0) log_warning(_("Query could not be sent to primary. %s\n"), PQerrorMessage(primaryConn));