MXS-359: Allow master changes mid-session

With the `allow_master_change` parameter enabled, sessions can start using
a different master node if one is available. This will not prevent
sessions from closing if a write query is received while no master
replacement is available.
This commit is contained in:
Markus Mäkelä
2018-03-06 18:58:13 +02:00
parent b18207282d
commit c2341a0003
4 changed files with 46 additions and 4 deletions

View File

@ -105,6 +105,24 @@ 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`
Allow the master server to change mid-session. This feature was introduced in
MaxScale 2.3.0 and is disabled by default.
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
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
* No transaction is open
* Autocommit is enabled
* No `LOAD DATA LOCAL INFILE` is in progress
* There are no queries being actively routed to the old master
## Router options
**`router_options`** may include multiple **readwritesplit**-specific options.