[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.

2018-09-04 13:01:04 info : (8846688) [readwritesplit] > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 127, type: QUERY_TYPE_READ, stmt: select * from tablename _locks where name = 'somewhat' 
2018-09-04 13:01:04 info : (8846688) [readwritesplit] Route query to slave [127.0.0.1]:6603 <

ERROR 1290 (HY000) at line 1: The MariaDB server is running with the --read-only option so it cannot execute this statement [maxscale@server maxscale_logs]$

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."
Knowledge Bse for update



 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.

Generated at Thu Feb 08 04:11:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.