From bacab8d31c89216112074aed006c39e0579f60e5 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 16 Aug 2018 11:50:54 +0900 Subject: [PATCH] "standby promote": improve log messages Make it clearer what repmgr is waiting for, and what to do if the promotion appears to fail. --- HISTORY | 1 + repmgr-action-standby.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/HISTORY b/HISTORY index bf85766f..78f64c3a 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,7 @@ 4.1.1 2018-??-?? repmgr: truncate version string, if necessary; GitHub #490 (Ian) + repmgr: improve messages emitted during "standby promote" (Ian) repmgrd: ensure that sending SIGHUP always results in the log file being reopened; GitHub #485 (Ian) repmgrd: report version number *after* logger initialisation; GitHub #487 (Ian) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 564a1ad6..86a14021 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -2050,6 +2050,8 @@ _do_standby_promote_internal(PGconn *conn) local_node_record.node_name, local_node_record.node_id, script); + log_detail(_("waiting up to %i seconds (parameter \"promote_check_timeout\") for promotion to complete"), + config_file_options.promote_check_timeout); r = system(script); if (r != 0) @@ -2075,6 +2077,8 @@ _do_standby_promote_internal(PGconn *conn) if (recovery_type == RECTYPE_STANDBY) { log_error(_("STANDBY PROMOTE failed, node is still a standby")); + log_detail(_("node still in recovery after %i seconds"), config_file_options.promote_check_timeout); + log_hint(_("the node may need more time to promote itself, check the PostgreSQL log for details")); PQfinish(conn); exit(ERR_PROMOTION_FAIL); }