[MXS-969] use_sql_variables_in=master can break functionality of important session variables Created: 2016-11-14 Updated: 2016-11-16 Resolved: 2016-11-16 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | readwritesplit |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | 2.0.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | markus makela |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Sprint: | 2016-22 |
| Description |
|
When use_sql_variables_in=master, the ReadWriteSplit router will route queries like the following only to the master:
In this specific case, it's very important that wsrep_sync_wait get set on the slaves. If the variable is only routed to the master, the application might see errors when queries don't return the expected results. https://mariadb.com/kb/en/mariadb/galera-cluster-system-variables/#wsrep_sync_wait Possible fixes:
|
| Comments |
| Comment by markus makela [ 2016-11-14 ] | ||||
|
This seems like a "bug" in readwritesplit and the query classifier. Both user variable modifications and global options are treated as the same type.
The latter query in the log excerpt should be detected as a modification to a user variable. | ||||
| Comment by Valerii Kravchuk [ 2016-11-15 ] | ||||
|
Same approach should probably be applied to:
and any
as session connecting via MaxScale assumes these are set and should not care what server it gets relayed to, master or slave. | ||||
| Comment by markus makela [ 2016-11-16 ] | ||||
|
The user variables are now properly detected and processed. The readwritesplit will send all user variable modifications and reads to the master. Normal system variable modifications are sent to all nodes. |