[MDEV-24731] Excessive mutex contention in DeadlockChecker::check_and_resolve() Created: 2021-01-29  Updated: 2021-06-14  Resolved: 2021-02-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.6.0

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: performance

Issue Links:
Blocks
blocks MDEV-24738 Improve the InnoDB deadlock checker Closed
PartOf
is part of MDEV-20612 Improve InnoDB lock_sys scalability Closed

 Description   

The function DeadlockChecker::check_and_resolve() is being executed while continuously holding lock_sys.mutex. Moving the deadlock detection to lock_wait() (which was refactored in MDEV-24671) will allow the check to release lock_sys.mutex between search iterations.

It may also be possible to avoid holding lock_sys.mutex altogether, and instead only use lock_sys.wait_mutex and various trx_t::mutex.



 Comments   
Comment by Matthias Leich [ 2021-02-03 ]

The tree bb-10.6-MDEV-24731 1fa2447ddb19e48bb66acd7a057a90fe52351f0d behaved well in RQG testing.

Comment by Marko Mäkelä [ 2021-02-04 ]

Thank you, mleich! The branch included more changes than just this one. Most of the extra changes were for MDEV-24738, which will need some more work.

Generated at Thu Feb 08 09:32:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.