Commit f98d2ef5 authored by Marko Mäkelä's avatar Marko Mäkelä

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 a0f02f74 (MDEV-32757).

Tested by: Axel Schwenke
Reviewed by: Vladislav Lesin
parent 2c60d43d
......@@ -681,6 +681,13 @@ void trx_purge_truncate_history()
if (prev != buf_pool.flush_hp.get())
{
/* The functions buf_pool_t::release_freed_page() or
buf_do_flush_list_batch() may be right now holding
buf_pool.mutex and waiting to acquire
buf_pool.flush_list_mutex. Ensure that they can proceed,
to avoid extreme waits. */
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
mysql_mutex_lock(&buf_pool.flush_list_mutex);
/* Rescan, because we may have lost the position. */
bpage= UT_LIST_GET_LAST(buf_pool.flush_list);
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment