diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 2c3268aa..4b094085 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -5230,6 +5230,18 @@ do_standby_switchover(void) format_lsn(replication_info.last_wal_receive_lsn), format_lsn(remote_last_checkpoint_lsn)); + /* + * optionally add a delay before promoting the standby; this is mainly + * useful for testing (e.g. for reappearance of the original primary) and + * is not documented. + */ + if (config_file_options.promote_delay > 0) + { + log_debug("sleeping %i seconds before promoting standby", + config_file_options.promote_delay); + sleep(config_file_options.promote_delay); + } + /* * Promote standby (local node). *