"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

@@ -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,