From 98af51da034279bddaf5132b65c2080b40fb77f6 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 20 Feb 2018 09:58:03 +0900 Subject: [PATCH] "node rejoin": ensure --dry-run is honoured Addresses GitHub #383. --- HISTORY | 5 ++++- repmgr-action-node.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 9b543197..30ea7bb1 100644 --- a/HISTORY +++ b/HISTORY @@ -1,4 +1,7 @@ -4.0.3 2018-02- +4.0.4 2018-??-?? + repmgr: ensure "node rejoin" honours "--dry-run" option; GitHub #383 (Ian) + +4.0.3 2018-02-15 repmgr: improve switchover handling when "pg_ctl" used to control the server and logging output is not explicitly redirected (Ian) repmgr: improve switchover log messages and exit code when old primary could diff --git a/repmgr-action-node.c b/repmgr-action-node.c index a1485e90..6f82f1f7 100644 --- a/repmgr-action-node.c +++ b/repmgr-action-node.c @@ -1814,7 +1814,7 @@ do_node_rejoin(void) * Forcibly rewind node if requested (this is mainly for use when this * action is being executed by "repmgr standby switchover") */ - if (runtime_options.force_rewind == true) + if (runtime_options.force_rewind == true && runtime_options.dry_run == false) { int ret; PQExpBufferData filebuf; @@ -1949,6 +1949,12 @@ do_node_rejoin(void) } } + if (runtime_options.dry_run == true) + { + log_info(_("prerequisites for executing NODE REJOIN are met")); + exit(SUCCESS); + } + initPQExpBuffer(&follow_output); success = do_standby_follow_internal(upstream_conn,