server
server copied to clipboard
MDEV-36330: SERIALIZABLE read inconsistency
- [x] The Jira issue number for this PR is: MDEV-36330
Description
trans_begin(): At SERIALIZABLE isolation level, handle START TRANSACTION in the same way as START TRANSACTION WITH CONSISTENT SNAPSHOT so that write/read conflicts can be detected.
innobase_start_trx_and_assign_read_view(): At any other isolation level than READ UNCOMMITTED, do create a read view. This is needed so that at SERIALIZABLE isolation level and innodb_snapshot_isolation=ON we are able to flag ER_CHECKREAD when reading data that was committed after the transaction started.
Release Notes
Transactions running at SERIALIZABLE isolation level failed to return ER_CHECKREAD for non-serializable executions (reading data that was committed after the current transaction started) even if innodb_snapshot_isolation=ON.
How can this PR be tested?
./mtr innodb.lock_isolation
Basing the PR against the correct MariaDB version
- [ ] This is a new feature or a refactoring, and the PR is based against the
mainbranch. - [x] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
PR quality check
- [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
- [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.