mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
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:
10
configdata.c
10
configdata.c
@@ -895,6 +895,16 @@ struct ConfigFileSetting config_file_settings[] =
|
|||||||
{},
|
{},
|
||||||
{}
|
{}
|
||||||
},
|
},
|
||||||
|
/* failover_delay */
|
||||||
|
{
|
||||||
|
"failover_delay",
|
||||||
|
CONFIG_INT,
|
||||||
|
{ .intptr = &config_file_options.failover_delay },
|
||||||
|
{ .intdefault = 0 },
|
||||||
|
{ .intminval = 1 },
|
||||||
|
{},
|
||||||
|
{}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"connection_check_query",
|
"connection_check_query",
|
||||||
CONFIG_STRING,
|
CONFIG_STRING,
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ typedef struct
|
|||||||
|
|
||||||
/* undocumented test settings */
|
/* undocumented test settings */
|
||||||
int promote_delay;
|
int promote_delay;
|
||||||
|
int failover_delay;
|
||||||
char connection_check_query[MAXLEN];
|
char connection_check_query[MAXLEN];
|
||||||
} t_configuration_options;
|
} t_configuration_options;
|
||||||
|
|
||||||
|
|||||||
@@ -4178,6 +4178,13 @@ do_election(NodeInfoList *sibling_nodes, int *new_primary_id)
|
|||||||
|
|
||||||
int nodes_with_primary_still_visible = 0;
|
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 */
|
/* we're visible */
|
||||||
stats.visible_nodes = 1;
|
stats.visible_nodes = 1;
|
||||||
stats.shared_upstream_nodes = 0;
|
stats.shared_upstream_nodes = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user