Details
-
Bug
-
Status: Stalled (View Workflow)
-
Critical
-
Resolution: Unresolved
-
10.6
-
None
Description
lock_rec_unlock_unmodified() is executed either under lock_sys.wr_lock() or under a combination of lock_sys.rd_lock() + record locks hash table cell latch. It also requests page latch to check if locked records were changed by the current transaction or not.
Usually InnoDB requests page latch to find the certain record on the page, and then requests lock_sys and/or record lock hash cell latch to request record lock. lock_rec_unlock_unmodified() requests the latches in the opposite order, what causes deadlocks. One of the possible scenario for the deadlock is the following:
- thread 1 - lock_rec_unlock_unmodified() is invoked under locks hash table cell latch, the latch is acquired;
- thread 2 - purge thread acquires page latch and tries to remove delete-marked record, it invokes lock_update_delete(), which requests locks hash table cell latch, held by thread 1;
- thread 1 - requests page latch, held by thread 2.
The above scenario can be reproduced with the attached test case: test.tar.gz .
Attachments
Issue Links
- blocks
-
MDEV-34466 XA prepare don't release unmodified records in non-blocking mode
- In Progress
- is caused by
-
MDEV-33454 release row locks for non-modified rows at XA PREPARE
- Closed
- is duplicated by
-
MDEV-34777 Wrong page mode during getting page from buffer pool for lock_rec_unlock_unmodified()
- Closed