[MXS-3550] write statistic is incremented for slaves Created: 2021-05-17  Updated: 2021-09-01  Resolved: 2021-08-04

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

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

Issue Links:
Problem/Incident
is caused by MXS-3468 Read statistics are wrong with master... Closed

 Description   

On a setup with two servers, the slave server's write statistic is incremented by either some command or a specific set of actions (unknown at this point). This is unexpected as nothing routed to a slave should be counted as a write.

Most likely a side-effect of the following commit from 2.5.11:

commit 2de10c9de12664e6d59f1ef879fd90d44b73d472
Author: Markus Mäkelä <markus.makela@mariadb.com>
Date:   Wed Apr 21 08:49:05 2021 +0300
 
    MXS-3468: Fix rwsplit query statistics
    
    The type of the query should determine whether the query is a write, not
    the target server where it ends up.



 Comments   
Comment by markus makela [ 2021-08-02 ]

A somewhat of a brute-force fix to this can be done by looking at the target type of the node we're routing a query to. If the old code would treat the command as a write, we can perform an extra check to make sure the node is our current master node before incrementing it. This will prevent the write statistic from being updated on slaves even if the query classifier classifies it as such.

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