[MXS-2043] Error "The MariaDB server is running with the --read-only option" for "select for update" Created: 2018-09-11 Updated: 2020-08-25 Resolved: 2018-09-27 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | readwritesplit |
| Affects Version/s: | 2.2.9 |
| Fix Version/s: | 2.2.15 |
| Type: | Bug | Priority: | Major |
| Reporter: | Richard Stracke | Assignee: | Johan Wikman |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Cent OS |
||
| Sprint: | MXS-SPRINT-66, MXS-SPRINT-67 |
| Description |
|
Under some circumstances, Maxscale route a "select .. for update" the the slave. If slave is read only, this error message will be returned.
Especially with autocommit enabled the error message makes no sense. " autocommit is set to 1, the LOCK IN SHARE MODE and FOR UPDATE clauses have no effect." |
| Comments |
| Comment by Johan Wikman [ 2018-09-25 ] |
|
The error message comes from the slave, so it would seem that the server being read only rejects the FOR UPDATE statement without considering whether the autocommit mode would renders the FOR UPDATE clause to have no effect. |
| Comment by Johan Wikman [ 2018-09-27 ] |
|
MaxScale now recognizes SELECT ... FOR UPDATE statements and classifies them as write, so they will now unconditionally be sent to the master. |