1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-30 05:23:50 +03:00
Files
mariadb/mysql-test/suite/innodb/t
Vlad Lesin 3ddc00dc3b MDEV-30225 RR isolation violation with locking unique search
Before the fix next-key lock was requested only if a record was
delete-marked for locking unique search in RR isolation level.
There can be several delete-marked records for the same unique key,
that's why InnoDB scans the records until eighter non-delete-marked record
is reached or all delete-marked records with the same unique key are
scanned.

For range scan next-key locks are used for RR to protect scanned range from
inserting new records by other transactions. And this is the reason of why
next-key locks are used for delete-marked records for unique searches.

If a record is not delete-marked, the requested lock type was "not-gap".
When a record is not delete-marked during lock request by trx 1, and
some other transaction holds conflicting lock, trx 1 creates waiting
not-gap lock on the record and suspends. During trx 1 suspending the
record can be delete-marked. And when the lock is granted on conflicting
transaction commit or rollback, its type is still "not-gap". So we have
"not-gap" lock on delete-marked record for RR. And this let some other
transaction to insert some record with the same unique key when trx 1 is
not committed, what can cause isolation level violation.

The fix is to set next-key locks for both delete-marked and
non-delete-marked records for unique search in RR.
2022-12-20 11:31:49 +03:00
..
2019-04-04 19:41:12 +03:00
2021-09-11 11:14:18 +03:00
2019-05-29 11:32:46 +03:00
2020-09-03 09:26:54 +03:00
2021-08-18 16:47:03 +03:00
2019-08-21 15:23:45 +03:00
2020-01-20 08:41:52 +02:00
2022-02-17 10:53:58 +02:00
2019-05-29 11:32:46 +03:00
2017-09-17 11:05:33 +03:00
2018-09-14 08:47:22 +02:00
2019-05-29 11:32:46 +03:00
2021-03-04 16:04:30 +02:00
2020-07-31 11:54:35 +03:00
2020-09-21 11:04:04 +03:00
2019-07-16 18:39:21 +03:00
2018-05-17 09:37:01 +03:00
2019-04-26 15:31:31 +03:00