diff --git a/server/modules/routing/readwritesplit/readwritesplit.cc b/server/modules/routing/readwritesplit/readwritesplit.cc index 90f81af4a..a1918f53c 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.cc +++ b/server/modules/routing/readwritesplit/readwritesplit.cc @@ -51,114 +51,6 @@ using namespace maxscale; /** Maximum number of slaves */ #define MAX_SLAVE_COUNT "255" -/** - * @brief Process router options - * - * @param router Router instance - * @param options Router options - * @return True on success, false if a configuration error was found - */ -static bool rwsplit_process_router_options(Config& config, char **options) -{ - if (options == NULL) - { - return true; - } - - MXS_WARNING("Router options for readwritesplit are deprecated."); - bool success = true; - - for (int i = 0; options[i]; i++) - { - char* value = strchr(options[i], '='); - - if (value == NULL) - { - MXS_ERROR("Unsupported router option \"%s\" for readwritesplit router.", options[i]); - success = false; - } - else - { - *value = 0; - value++; - if (strcmp(options[i], "slave_selection_criteria") == 0) - { - select_criteria_t c = GET_SELECT_CRITERIA(value); - mxb_assert(c == LEAST_GLOBAL_CONNECTIONS || - c == LEAST_ROUTER_CONNECTIONS || c == LEAST_BEHIND_MASTER || - c == LEAST_CURRENT_OPERATIONS || c == LOWEST_RESPONSE_TIME || - c == UNDEFINED_CRITERIA); - - if (c == UNDEFINED_CRITERIA) - { - MXS_ERROR("Unknown slave selection criteria \"%s\". " - "Allowed values are LEAST_GLOBAL_CONNECTIONS, " - "LEAST_ROUTER_CONNECTIONS, LEAST_BEHIND_MASTER, " - "LEAST_CURRENT_OPERATIONS and LOWEST_RESPONSE_TIME.", - STRCRITERIA(config.slave_selection_criteria)); - success = false; - } - else - { - config.slave_selection_criteria = c; - } - } - else if (strcmp(options[i], "max_sescmd_history") == 0) - { - config.max_sescmd_history = atoi(value); - } - else if (strcmp(options[i], "disable_sescmd_history") == 0) - { - config.disable_sescmd_history = config_truth_value(value); - } - else if (strcmp(options[i], "master_accept_reads") == 0) - { - config.master_accept_reads = config_truth_value(value); - } - else if (strcmp(options[i], "strict_multi_stmt") == 0) - { - config.strict_multi_stmt = config_truth_value(value); - } - else if (strcmp(options[i], "strict_sp_calls") == 0) - { - config.strict_sp_calls = config_truth_value(value); - } - else if (strcmp(options[i], "retry_failed_reads") == 0) - { - config.retry_failed_reads = config_truth_value(value); - } - else if (strcmp(options[i], "master_failure_mode") == 0) - { - if (strcasecmp(value, "fail_instantly") == 0) - { - config.master_failure_mode = RW_FAIL_INSTANTLY; - } - else if (strcasecmp(value, "fail_on_write") == 0) - { - config.master_failure_mode = RW_FAIL_ON_WRITE; - } - else if (strcasecmp(value, "error_on_write") == 0) - { - config.master_failure_mode = RW_ERROR_ON_WRITE; - } - else - { - MXS_ERROR("Unknown value for 'master_failure_mode': %s", value); - success = false; - } - } - else - { - MXS_ERROR("Unknown router option \"%s=%s\" for readwritesplit router.", - options[i], value); - success = false; - } - } - } - - return success; -} - // TODO: Don't process parameters in readwritesplit static bool handle_max_slaves(Config& config, const char *str) { diff --git a/server/modules/routing/readwritesplit/readwritesplit.hh b/server/modules/routing/readwritesplit/readwritesplit.hh index fd721a126..23efca796 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.hh +++ b/server/modules/routing/readwritesplit/readwritesplit.hh @@ -127,18 +127,6 @@ static const MXS_ENUM_VALUE master_failure_mode_values[] = #define CONFIG_MAX_SLAVE_RLAG -1 /**< not used */ #define CONFIG_SQL_VARIABLES_IN TYPE_ALL -#define GET_SELECT_CRITERIA(s) \ - (strncmp(s,"LEAST_GLOBAL_CONNECTIONS", strlen("LEAST_GLOBAL_CONNECTIONS")) == 0 ? \ - LEAST_GLOBAL_CONNECTIONS : ( \ - strncmp(s,"LEAST_BEHIND_MASTER", strlen("LEAST_BEHIND_MASTER")) == 0 ? \ - LEAST_BEHIND_MASTER : ( \ - strncmp(s,"LEAST_ROUTER_CONNECTIONS", strlen("LEAST_ROUTER_CONNECTIONS")) == 0 ? \ - LEAST_ROUTER_CONNECTIONS : ( \ - strncmp(s,"LEAST_CURRENT_OPERATIONS", strlen("LEAST_CURRENT_OPERATIONS")) == 0 ? \ - LEAST_CURRENT_OPERATIONS : ( \ - strncmp(s,"LOWEST_RESPONSE_TIME", strlen("LOWEST_RESPONSE_TIME")) == 0 ? \ - LOWEST_RESPONSE_TIME : UNDEFINED_CRITERIA))))) - #define BACKEND_TYPE(b) (server_is_master((b)->backend_server) ? BE_MASTER : \ (server_is_slave((b)->backend_server) ? BE_SLAVE : BE_UNDEFINED));