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:
@ -105,7 +105,7 @@ connections alive even if they are not used. This is a common problem if the
|
||||
backend servers have a low _wait_timeout_ value and the client connections live
|
||||
for a long time.
|
||||
|
||||
### `allow_master_change`
|
||||
### `master_reconnection`
|
||||
|
||||
Allow the master server to change mid-session. This feature was introduced in
|
||||
MaxScale 2.3.0 and is disabled by default.
|
||||
@ -114,7 +114,7 @@ When a readwritesplit session starts, it will pick a master server as the
|
||||
current master server of that session. By default, when this master server
|
||||
changes mid-session, the connection will be closed.
|
||||
|
||||
If the `allow_master_change` parameter is enabled, the master server is allowed
|
||||
If the `master_reconnection` parameter is enabled, the master server is allowed
|
||||
to change as long as the session meets the following criteria:
|
||||
|
||||
* The session is already connected to the slave that was chosen to be the new master
|
||||
@ -123,7 +123,7 @@ to change as long as the session meets the following criteria:
|
||||
* No `LOAD DATA LOCAL INFILE` is in progress
|
||||
* There are no queries being actively routed to the old master
|
||||
|
||||
When `allow_master_change` is enabled in conjunction with either
|
||||
When `master_reconnection` is enabled in conjunction with either
|
||||
`master_failure_mode=fail_on_write` or `master_failure_mode=error_on_write`, the
|
||||
session can recover from the loss of a master server. This means that when a
|
||||
session starts without a master server and later a slave server that it is
|
||||
@ -295,7 +295,7 @@ long as slave servers are available.
|
||||
**Note:** If _master_failure_mode_ is set to _error_on_write_ and the connection
|
||||
to the master is lost, by default, clients will not be able to execute write
|
||||
queries without reconnecting to MariaDB MaxScale once a new master is
|
||||
available. If [`allow_master_change`](#allow_master_change) is enabled, the
|
||||
available. If [`master_reconnection`](#master_reconnection) is enabled, the
|
||||
session can recover if one of the slaves is promoted as the master.
|
||||
|
||||
### `retry_failed_reads`
|
||||
|
@ -16,7 +16,7 @@ router=readwritesplit
|
||||
servers=server1,server2,server3,server4
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
allow_master_change=true
|
||||
master_reconnection=true
|
||||
master_failure_mode=error_on_write
|
||||
|
||||
[RW-Split-Listener]
|
||||
|
@ -16,7 +16,7 @@ router=readwritesplit
|
||||
servers=server1,server2,server3,server4
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
allow_master_change=true
|
||||
master_reconnection=true
|
||||
|
||||
[RW-Split-Listener]
|
||||
type=listener
|
||||
|
@ -16,7 +16,7 @@ router=readwritesplit
|
||||
servers=server1,server2,server3,server4
|
||||
user=maxskysql
|
||||
passwd=skysql
|
||||
allow_master_change=true
|
||||
master_reconnection=true
|
||||
master_failure_mode=fail_on_write
|
||||
|
||||
[RW-Split-Listener]
|
||||
|
@ -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}
|
||||
}
|
||||
};
|
||||
|
@ -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 */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user