mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
repmgrd: add configuration option "always_promote"
In certain corner cases, it's possible repmgrd may end up monitoring a standby which was a former primary, but the node record has not yet been updated. Previously repmgrd would abort the promotion with a cryptic message about being unable to find a node record for node_id -1 (the default value for an unknown node id). This commit addes a new configuration option "always_promote", which determines whether repmgrd should promote the node in this case. The default is "false", to effectively maintain the existing behaviour. Logging output has also been improved to make it clearer what has happened when this situation occurs.
This commit is contained in:
10
configfile.c
10
configfile.c
@@ -867,6 +867,7 @@ parse_time_unit_parameter(const char *name, const char *value, char *dest, ItemL
|
||||
* - monitoring_history
|
||||
* - primary_notification_timeout
|
||||
* - primary_visibility_consensus
|
||||
* - always_promote
|
||||
* - promote_command
|
||||
* - reconnect_attempts
|
||||
* - reconnect_interval
|
||||
@@ -1239,6 +1240,15 @@ reload_config(t_server_type server_type)
|
||||
format_bool(config_file_options.primary_visibility_consensus));
|
||||
}
|
||||
|
||||
/* always_promote */
|
||||
if (config_file_options.always_promote != orig_config_file_options.always_promote)
|
||||
{
|
||||
item_list_append_format(&config_changes,
|
||||
_("\"always_promote\" changed from \"%s\" to \"%s\""),
|
||||
format_bool(orig_config_file_options.always_promote),
|
||||
format_bool(config_file_options.always_promote));
|
||||
}
|
||||
|
||||
/* failover_validation_command */
|
||||
if (strncmp(config_file_options.failover_validation_command, orig_config_file_options.failover_validation_command, sizeof(config_file_options.failover_validation_command)) != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user