diff --git a/config.c b/config.c index b88b8bc9..2e161453 100644 --- a/config.c +++ b/config.c @@ -233,7 +233,7 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList * /* repmgrd settings * ---------------- */ - options->failover_mode = MANUAL_FAILOVER; + options->failover_mode = FAILOVER_MANUAL; options->priority = DEFAULT_PRIORITY; memset(options->promote_command, 0, sizeof(options->promote_command)); memset(options->follow_command, 0, sizeof(options->follow_command)); @@ -374,15 +374,16 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList * { if (strcmp(value, "manual") == 0) { - options->failover_mode = MANUAL_FAILOVER; + options->failover_mode = FAILOVER_MANUAL; } else if (strcmp(value, "automatic") == 0) { - options->failover_mode = AUTOMATIC_FAILOVER; + options->failover_mode = FAILOVER_MANUAL; } else { - item_list_append(error_list, _("value for 'failover' must be 'automatic' or 'manual'\n")); + item_list_append(error_list, + _("value for \"failover\" must be \"automatic\" or \"manual\"\n")); } } else if (strcmp(name, "priority") == 0) @@ -461,19 +462,19 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList * else if (strcmp(name, "failover") == 0) { item_list_append(warning_list, - _("parameter \"failover\" has been renamed 'failover_mode'")); + _("parameter \"failover\" has been renamed to \"failover_mode\"")); known_parameter = false; } else if (strcmp(name, "node") == 0) { item_list_append(warning_list, - _("parameter \"node\" has been renamed 'node_id'")); + _("parameter \"node\" has been renamed to \"node_id\"")); known_parameter = false; } else if (strcmp(name, "upstream_node") == 0) { item_list_append(warning_list, - _("parameter \"upstream_node\" has been renamed 'upstream_node_id'")); + _("parameter \"upstream_node\" has been renamed to \"upstream_node_id\"")); known_parameter = false; } else diff --git a/config.h b/config.h index cc926532..aab5a201 100644 --- a/config.h +++ b/config.h @@ -14,6 +14,10 @@ #define MAXLINELENGTH 4096 extern bool config_file_found; +typedef enum { + FAILOVER_MANUAL, + FAILOVER_AUTOMATIC +} failover_mode_opt; typedef struct EventNotificationListCell { @@ -68,7 +72,7 @@ typedef struct TablespaceList tablespace_mapping; /* repmgrd settings */ - int failover_mode; + failover_mode_opt failover_mode; int priority; char promote_command[MAXLEN]; char follow_command[MAXLEN]; @@ -116,7 +120,7 @@ typedef struct /* standby clone settings */ \ false, "", "", "", "", { NULL, NULL }, \ /* repmgrd settings */ \ - MANUAL_FAILOVER, DEFAULT_PRIORITY, "", "", 2, 60, 6, 10, 300, false, \ + FAILOVER_MANUAL, DEFAULT_PRIORITY, "", "", 2, 60, 6, 10, 300, false, \ /* witness settings */ \ 30, \ /* service settings */ \ diff --git a/repmgr.h b/repmgr.h index 8021dc00..272d88d1 100644 --- a/repmgr.h +++ b/repmgr.h @@ -33,8 +33,6 @@ #define BDR_MONITORING_LOCAL 1 #define BDR_MONITORING_PRIORITY 2 -#define MANUAL_FAILOVER 0 -#define AUTOMATIC_FAILOVER 1 #define DEFAULT_PRIORITY 100 #define FAILOVER_NODES_MAX_CHECK 50