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.