[MXS-3468] Read statistics are wrong with master_accept_reads and read-only transactions Created: 2021-03-29  Updated: 2021-05-31  Resolved: 2021-04-22

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 2.5.9
Fix Version/s: 2.5.11

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File rw2.txt    
Issue Links:
Problem/Incident
causes MXS-3550 write statistic is incremented for sl... Closed
Sprint: MXS-SPRINT-129

 Description   

When master_accept_reads is enabled, read-only transactions that are routed to the master aren't counted as reads.



 Comments   
Comment by Axel Schwenke [ 2021-03-29 ]

using this as test.lua

require("oltp_common")

function prepare_statements()
– empty
end

function event()
con:query("START TRANSACTION READ ONLY")
print(con:query_row("select variable_value from information_schema.global_variables where variable_name='hostname'"))
con:query("COMMIT")
end

and with that command line:

sysbench test.lua --mysql-host=127.0.0.1 --mysql-port=6611 --mysql-user=... --mysql-password=... --mysql-db=sbtest --threads=20 --events=20 run

I can see that the service with master_accept_reads=true indeed gets routed to the master. Whereas the service without that line gets routed to the slaves.

Must be a bug in the reporting then. See attachment rw2.txt

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