mleich provided rr replay traces of a 10.6 based testing branch where InnoDB shutdown would hang after shrinking the InnoDB buffer pool was initiated.
This might have been caused by
MDEV-26827 in 10.6.13. The fix of MDEV-32029 did refactor some related code, but I don’t think the hang should be related to that. The reason for the hang is that buf_flush_wait_LRU_batch_end() (invoked by buf_pool_t::withdraw_blocks() when shrinking the buffer pool) would wait indefinitely for buf_pool.done_flush_LRU, and the buf_flush_page_cleaner() would wait indefinitely for buf_pool.do_flush_list. I think that the fix (to be tested by mleich) would be as follows: