From 0a70d907aee3700d10b4b2561135ea2b22b9ec0c Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Wed, 10 Jul 2013 19:25:58 -0500 Subject: [PATCH] Improve messages in wait_connection_availability, so we know what error makes the failover procedure to start By gripe from Andres Freund --- dbutils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbutils.c b/dbutils.c index ca7ac4bc..0aef3964 100644 --- a/dbutils.c +++ b/dbutils.c @@ -409,7 +409,7 @@ wait_connection_availability(PGconn *conn, int timeout) { if (PQconsumeInput(conn) == 0) { - log_warning(_("PQconsumeInput: Query could not be sent to primary. %s\n"), + log_warning(_("wait_connection_availability: could not receive data from master. %s\n"), PQerrorMessage(conn)); return 0; } @@ -425,8 +425,10 @@ wait_connection_availability(PGconn *conn, int timeout) } if (timeout >= 0) return 1; - else + else { + log_warning(_("wait_connection_availability: timeout reached"); return -1; + } }