repmgrd: add parameter "failover_delay"

This parameter is not documented and intended for use during testing.
It should not be used in production.
This commit is contained in:
Ian Barwick
2020-10-05 16:38:57 +09:00
parent 9aaf7d79a2
commit 5b254a1be9
3 changed files with 18 additions and 0 deletions

View File

@@ -4178,6 +4178,13 @@ do_election(NodeInfoList *sibling_nodes, int *new_primary_id)
int nodes_with_primary_still_visible = 0;
if (config_file_options.failover_delay > 0)
{
log_debug("sleeping %i seconds (\"failover_delay\") before initiating failover",
config_file_options.failover_delay);
sleep(config_file_options.failover_delay);
}
/* we're visible */
stats.visible_nodes = 1;
stats.shared_upstream_nodes = 0;