mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
config: fix parsing of "replication_type"
This is a legacy parameter which can currently only contain one value, "physical" (the default). It can be safely omitted. Addresses GitHub #672.
This commit is contained in:
36
configfile.c
36
configfile.c
@@ -313,6 +313,9 @@ _parse_config(ItemList *error_list, ItemList *warning_list)
|
||||
case CONFIG_CONNECTION_CHECK_TYPE:
|
||||
*setting->val.checktypeptr = setting->defval.checktypedefault;
|
||||
break;
|
||||
case CONFIG_REPLICATION_TYPE:
|
||||
*setting->val.replicationtypeptr = setting->defval.replicationtypedefault;
|
||||
break;
|
||||
case CONFIG_EVENT_NOTIFICATION_LIST:
|
||||
case CONFIG_TABLESPACE_MAPPING:
|
||||
/* no default for these types; lists cleared above */
|
||||
@@ -566,6 +569,20 @@ parse_configuration_item(ItemList *error_list, ItemList *warning_list, const cha
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONFIG_REPLICATION_TYPE:
|
||||
{
|
||||
if (strcasecmp(value, "physical") == 0)
|
||||
{
|
||||
*(ReplicationType *)setting->val.replicationtypeptr = REPLICATION_TYPE_PHYSICAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
item_list_append_format(error_list,
|
||||
_("value for \"%s\" must be \"physical\"\n"),
|
||||
name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONFIG_EVENT_NOTIFICATION_LIST:
|
||||
{
|
||||
parse_event_notifications_list((EventNotificationList *)setting->val.notificationlistptr,
|
||||
@@ -1394,6 +1411,11 @@ dump_config(void)
|
||||
case CONFIG_CONNECTION_CHECK_TYPE:
|
||||
printf("%s", print_connection_check_type(*setting->val.checktypeptr));
|
||||
break;
|
||||
case CONFIG_REPLICATION_TYPE:
|
||||
{
|
||||
printf("%s", print_replication_type(*setting->val.replicationtypeptr));
|
||||
break;
|
||||
}
|
||||
case CONFIG_EVENT_NOTIFICATION_LIST:
|
||||
{
|
||||
char *list = print_event_notification_list(setting->val.notificationlistptr);
|
||||
@@ -2167,6 +2189,20 @@ parse_pg_basebackup_options(const char *pg_basebackup_options, t_basebackup_opti
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
print_replication_type(ReplicationType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case REPLICATION_TYPE_PHYSICAL:
|
||||
return "physical";
|
||||
}
|
||||
|
||||
/* should never reach here */
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
print_connection_check_type(ConnectionCheckType type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user