[MDEV-29384] Hangs caused by innodb_adaptive_hash_index=ON Created: 2022-08-25  Updated: 2023-09-21  Resolved: 2022-08-25

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.8.0, 10.5.4, 10.2.33, 10.3.24, 10.4.14, 10.6.0, 10.7.0, 10.9.0, 10.10.0
Fix Version/s: 10.3.37, 10.4.27, 10.5.18, 10.6.10, 10.7.6, 10.8.5, 10.9.3, 10.10.2

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

Issue Links:
Problem/Incident
is caused by MDEV-22456 Dropping the adaptive hash index may ... Closed
is caused by MDEV-22790 Race between btr_page_mtr_lock() drop... Closed

 Description   

A race condition that was caused by MDEV-22456 was incorrectly fixed in MDEV-22790, by attempting to acquire an exclusive page latch, while acquiring an exclusive adaptive hash index partition latch would have been appropriate.

Any attempt to upgrade page latches is prone to deadlocks. Recently, we observed a few hangs that involved nothing more than a small table consisting of one clustered index page, one secondary index page and some undo pages. Those hangs were observed on 10.6, involving the function mtr_t::defer_drop_ahi(). The corresponding function buf_defer_drop_ahi() in earlier releases is equally problematic.

Now that the race condition was correctly fixed in MDEV-27700, we can simply invoke btr_search_drop_page_hash_index(block, true) whenever we are holding a page latch, to collect any garbage that was left behind by MDEV-22456. There should be no need to upgrade any page latches.


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