[MXS-1649] Should route all queries to master in serializable isolation level Created: 2018-02-06  Updated: 2020-03-19  Resolved: 2020-03-18

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: None
Fix Version/s: 2.5.0

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

Sprint: MXS-SPRINT-101, MXS-SPRINT-102

 Description   

This is not only affect correctness but also affect replication:

In serializable isolation level , if a user thread is reading some record for a long time, and the sql thread want to apply binlog which would update the same record, then sql thread will be blocked by S lock util timeout, then the replication will be paused;

Although we should advice user not use serializable iso level in rwsplit service, but when they do we should avoid interrupting replication too;



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

We'd be interested in having some sort of a test case to see how the server behaves when SERIALIZABLE reads are done on a slave. Could you add a small example that shows this? We can then add it to the MariaDB server test suite to know whether it works the way it is expected to work or whether there's something we can fix.

Comment by markus makela [ 2020-03-09 ]

If a server has session_track_transaction_info=CHARACTERISTICS or session_track_system_variables=tx_isolation enabled, readwritesplit will lock the session to the master whenever the isolation mode is set to SERIALIZABLE. This is documented in the routing decisions section of the readwritesplit documentation: https://github.com/mariadb-corporation/MaxScale/blob/develop/Documentation/Routers/ReadWriteSplit.md#transaction-isolation-level-tracking

Comment by markus makela [ 2020-03-16 ]

The locking to the master needs to be removed if a session goes out of SERIALIZABLE.

Comment by markus makela [ 2020-03-18 ]

Since this is not recommended behavior, the extra functionality for it does't really need to be added. The locking to master is more of a workaround for the bad behavior that it causes.

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