Skip to content

Commit f98d2ef

Browse files
committed
MDEV-33009 Server hangs for a long time with innodb_undo_log_truncate=ON
trx_purge_truncate_history(): Release buf_pool.flush_list_mutex before starting a rescan of buf_pool.flush_list, to ensure that the buf_flush_page_cleaner thread (which may be holding buf_pool.mutex) will be able to proceed. This fixes up commit a0f02f7 (MDEV-32757). Tested by: Axel Schwenke Reviewed by: Vladislav Lesin
1 parent 2c60d43 commit f98d2ef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

storage/innobase/trx/trx0purge.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,13 @@ void trx_purge_truncate_history()
681681

682682
if (prev != buf_pool.flush_hp.get())
683683
{
684+
/* The functions buf_pool_t::release_freed_page() or
685+
buf_do_flush_list_batch() may be right now holding
686+
buf_pool.mutex and waiting to acquire
687+
buf_pool.flush_list_mutex. Ensure that they can proceed,
688+
to avoid extreme waits. */
689+
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
690+
mysql_mutex_lock(&buf_pool.flush_list_mutex);
684691
/* Rescan, because we may have lost the position. */
685692
bpage= UT_LIST_GET_LAST(buf_pool.flush_list);
686693
continue;

0 commit comments

Comments
 (0)