"node rejoin": ensure --dry-run is honoured

Addresses GitHub #383.
This commit is contained in:
Ian Barwick
2018-02-20 09:58:03 +09:00
parent a80e22f0ed
commit 14420d83fa
2 changed files with 11 additions and 2 deletions

View File

@@ -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 repmgr: improve switchover handling when "pg_ctl" used to control the
server and logging output is not explicitly redirected (Ian) server and logging output is not explicitly redirected (Ian)
repmgr: improve switchover log messages and exit code when old primary could repmgr: improve switchover log messages and exit code when old primary could

View File

@@ -1814,7 +1814,7 @@ do_node_rejoin(void)
* Forcibly rewind node if requested (this is mainly for use when this * Forcibly rewind node if requested (this is mainly for use when this
* action is being executed by "repmgr standby switchover") * 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; int ret;
PQExpBufferData filebuf; 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); initPQExpBuffer(&follow_output);
success = do_standby_follow_internal(upstream_conn, success = do_standby_follow_internal(upstream_conn,