MXS-359: Rename parameter to master_reconnection

Changing the parameter name to `master_reconnection` allows similar
reconnection functionality to be combined under one parameter.
This commit is contained in:
Markus Mäkelä
2018-03-28 09:49:30 +03:00
parent 3f803ab3e8
commit 481db8acbc
7 changed files with 11 additions and 11 deletions

View File

@ -1495,7 +1495,7 @@ MXS_MODULE *MXS_CREATE_MODULE()
{"connection_keepalive", MXS_MODULE_PARAM_COUNT, "0"},
{"enable_causal_read", MXS_MODULE_PARAM_BOOL, "false"},
{"causal_read_timeout", MXS_MODULE_PARAM_STRING, "0"},
{"allow_master_change", MXS_MODULE_PARAM_BOOL, "false"},
{"master_reconnection", MXS_MODULE_PARAM_BOOL, "false"},
{MXS_END_MODULE_PARAMS}
}
};

View File

@ -175,7 +175,7 @@ struct Config
max_slave_connections(0),
enable_causal_read(config_get_bool(params, "enable_causal_read")),
causal_read_timeout(config_get_string(params, "causal_read_timeout")),
allow_master_change(config_get_bool(params, "allow_master_change"))
master_reconnection(config_get_bool(params, "master_reconnection"))
{
if (enable_causal_read)
{
@ -202,7 +202,7 @@ struct Config
int max_slave_connections; /**< Maximum number of slaves for each connection*/
bool enable_causal_read; /**< Enable causual read */
std::string causal_read_timeout; /**< Timetout, second parameter of function master_wait_gtid */
bool allow_master_change; /**< Allow changes in master server */
bool master_reconnection; /**< Allow changes in master server */
};
/**

View File

@ -690,7 +690,7 @@ static void log_master_routing_failure(RWSplitSession *rses, bool found,
bool should_replace_master(RWSplitSession *rses, SRWBackend& target)
{
return rses->rses_config.allow_master_change &&
return rses->rses_config.master_reconnection &&
// We have a target server and it's not the current master
target && target != rses->current_master &&
// We are not inside a transaction (also checks for autocommit=1)