Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
N/A
Description
MDEV-27058 introduced a deadlock between trx_purge_truncate_history() and buf_pool_t::release_freed_page(). The former function is holding buf_pool.flush_list_mutex while waiting for a page X-latch:
mysql_mutex_lock(&buf_pool.flush_list_mutex);
|
|
for (buf_page_t *bpage= UT_LIST_GET_LAST(buf_pool.flush_list); bpage; ) |
{
|
…
|
bpage->lock.x_lock();
|
At the same time, buf_pool_t::release_freed_page() may hold a U-latch on this page while waiting for buf_pool.flush_list_mutex.
Before MDEV-27058, there was no problem here, because we would first buffer-fix the block, then release buf_pool.flush_list_mutex and only then acquire the block X-latch.
To fix this, we may invoke bpage->lock.x_lock_try() instead. If it fails, we may release and reacquire buf_pool.flush_list_mutex and restart the scan.
Because MDEV-27058 was not part of any release yet, this regression does not affect any release.
Attachments
Issue Links
- is caused by
-
MDEV-27058 Buffer page descriptors are too large
- Closed
- relates to
-
MDEV-30180 Server hang with innodb_undo_log_truncate=ON
- Closed
-
MDEV-31343 Another server hang with innodb_undo_log_truncate=ON
- Closed