From 638a119c85d7df6bd2771c506847ae8d290a5ce7 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 7 Jun 2018 11:02:32 +0900 Subject: [PATCH] standby follow: add hint about using "node rejoin" If "repmgr standby follow" is executed on a node which isn't running, point out "repmgr node rejoin" should probably be used instead. --- repmgr-action-standby.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index ae998b0f..c382232c 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -2159,7 +2159,13 @@ do_standby_follow(void) log_verbose(LOG_DEBUG, "do_standby_follow()"); - local_conn = establish_db_connection(config_file_options.conninfo, true); + local_conn = establish_db_connection(config_file_options.conninfo, false); + + if (PQstatus(local_conn) != CONNECTION_OK) + { + log_hint(_("use \"repmgr node rejoin\" to re-add an inactive node to the replication cluster")); + exit(ERR_DB_CONN); + } log_verbose(LOG_INFO, _("connected to local node"));