Change strict_multi_stmt default value

The default value for strict_multi_stmt prevents compound statements and
atomic multi-statement commands from being executed without completely
disabling load balancing. As the new default value will have no practical
effect on all correct uses of readwritesplit, this is a relatively safe
thing to change.
This commit is contained in:
Markus Mäkelä
2017-12-20 23:50:07 +02:00
parent 9062c31865
commit d4aeca0d24
3 changed files with 29 additions and 12 deletions

View File

@ -50,6 +50,21 @@ root@host:~# maxscale --user=root ...
The default value of the configuration parameter `detect_standalone_master` has The default value of the configuration parameter `detect_standalone_master` has
been changed from `false` to `true`. been changed from `false` to `true`.
### ReadWritesplit
The default value of `strict_multi_stmt` was changed to `false` to make
usage of atomic compound statements and multi-statement queries less
restrictive and to align it with the default value of `strict_sp_calls`.
Most cases where the functionality of `strict_multi_stmt` was triggered
were cases where the added safety of locking a session to the master did
more harm than it did good.
The only case where `strict_multi_stmt` should be enabled is when a
multi-statement or a compound statement modifies the state of the
session. This is not a good practice and a change in the client side
behavior is advised.
## Dropped Features ## Dropped Features
## New Features ## New Features

View File

@ -220,21 +220,23 @@ router_options=master_accept_reads=true
### `strict_multi_stmt` ### `strict_multi_stmt`
When a client executes a multi-statement query, all queries after that will be This option is disabled by default since MaxScale 2.2.1. In older versions, this
routed to the master to guarantee a consistent session state. This behavior can option was enabled by default.
be controlled with the **`strict_multi_stmt`** router option. This option is
enabled by default.
If set to false, queries are routed normally after a multi-statement query. When a client executes a multi-statement query, it will be treated as if it were
a DML statement and routed to the master. If the option is enabled, all queries
after a multi-statement query will be routed to the master to guarantee a
consistent session state.
**Warning:** this can cause false data to be read from the slaves if the If the feature is disabled, queries are routed normally after a multi-statement
multi-statement query modifies the session state. Only disable the strict mode query.
if you know that no changes to the session state will be made inside the
multi-statement queries. **Warning:** Enable the strict mode only if you know that the clients will send
statements that cause inconsistencies in the session state.
``` ```
# Disable strict multi-statement mode # Enable strict multi-statement mode
router_options=strict_multi_stmt=false router_options=strict_multi_stmt=true
``` ```
### `strict_sp_calls` ### `strict_sp_calls`

View File

@ -1432,7 +1432,7 @@ MXS_MODULE *MXS_CREATE_MODULE()
{"retry_failed_reads", MXS_MODULE_PARAM_BOOL, "true"}, {"retry_failed_reads", MXS_MODULE_PARAM_BOOL, "true"},
{"disable_sescmd_history", MXS_MODULE_PARAM_BOOL, "true"}, {"disable_sescmd_history", MXS_MODULE_PARAM_BOOL, "true"},
{"max_sescmd_history", MXS_MODULE_PARAM_COUNT, "0"}, {"max_sescmd_history", MXS_MODULE_PARAM_COUNT, "0"},
{"strict_multi_stmt", MXS_MODULE_PARAM_BOOL, "true"}, {"strict_multi_stmt", MXS_MODULE_PARAM_BOOL, "false"},
{"strict_sp_calls", MXS_MODULE_PARAM_BOOL, "false"}, {"strict_sp_calls", MXS_MODULE_PARAM_BOOL, "false"},
{"master_accept_reads", MXS_MODULE_PARAM_BOOL, "false"}, {"master_accept_reads", MXS_MODULE_PARAM_BOOL, "false"},
{"connection_keepalive", MXS_MODULE_PARAM_COUNT, "0"}, {"connection_keepalive", MXS_MODULE_PARAM_COUNT, "0"},