[MXS-3915] Autocommit tracking doesn't work correctly Created: 2021-12-14  Updated: 2022-07-13  Resolved: 2021-12-15

Status: Closed
Project: MariaDB MaxScale
Component/s: QueryClassifier
Affects Version/s: 6.1.4
Fix Version/s: 6.2.1

Type: Bug Priority: Critical
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 1
Labels: None


 Description   

The following example SQL demonstrates the problem when executed through readwritesplit.

SET autocommit=0;
COMMIT;
SET autocommit=1;
SELECT @@server_id, @@hostname;

The last statement should be routed as an autocommit read but it is treated as if autocommit was still disabled.

This is caused by a bug in an optimization for the transaction tracking code that reuses the query classification result instead of parsing the query multiple times. Due to the query classification cache, the canonical form of both autocommit statements would be SET autocommit=? and they would both be classified as the query type that first arrived. The solution is to never insert these types of queries into the cache.



 Comments   
Comment by markus makela [ 2021-12-15 ]

Theoretically this could affect 2.4 and 2.5 as well but in practice it's only possible with 6.

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