diff --git a/Documentation/Routers/ReadWriteSplit.md b/Documentation/Routers/ReadWriteSplit.md index 31cffe41a..a03b9e9e7 100644 --- a/Documentation/Routers/ReadWriteSplit.md +++ b/Documentation/Routers/ReadWriteSplit.md @@ -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` diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_error_on_write b/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_error_on_write index 544203605..15eec8fbc 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_error_on_write +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_error_on_write @@ -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] diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_master_switch b/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_master_switch index 98b5476b6..234dd3266 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_master_switch +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_master_switch @@ -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 diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_read_only b/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_read_only index b476f7942..639349a0c 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_read_only +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs359_read_only @@ -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] diff --git a/server/modules/routing/readwritesplit/readwritesplit.cc b/server/modules/routing/readwritesplit/readwritesplit.cc index c428c228f..6ecc3076a 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.cc +++ b/server/modules/routing/readwritesplit/readwritesplit.cc @@ -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} } }; diff --git a/server/modules/routing/readwritesplit/readwritesplit.hh b/server/modules/routing/readwritesplit/readwritesplit.hh index b874a3a23..d900ea163 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.hh +++ b/server/modules/routing/readwritesplit/readwritesplit.hh @@ -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 */ }; /** diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc index 491bd4c33..f156bee18 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc @@ -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)