server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-36330: SERIALIZABLE read inconsistency

Open dr-m opened this issue 6 months ago • 1 comments

  • [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 main branch.
  • [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.

dr-m avatar May 19 '25 09:05 dr-m