Skip to content

Commit

Permalink
MDEV-35409 InnoDB can still hang while running out of buffer pool
Browse files Browse the repository at this point in the history
buf_pool_t::LRU_warn(): Also clear the try_LRU_scan flag, to ensure
that need_LRU_eviction() will hold. This should ensure progress when
buf_LRU_get_free_block() is expecting buf_flush_page_cleaner() to
make some room, even when buf_pool.LRU.count is small.

This hang was observed in trx_lists_init_at_db_start() while the last
batch of crash recovery was in progress, but it could theoretically
be possible also when a large part of the buffer pool is occupied by
record locks or the adaptive hash index.

Reviewed by: Debarun Banerjee
  • Loading branch information
dr-m committed Nov 18, 2024
1 parent d5f16d6 commit ba69d81
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions storage/innobase/buf/buf0flu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2564,6 +2564,7 @@ static void buf_flush_page_cleaner()
ATTRIBUTE_COLD void buf_pool_t::LRU_warn()
{
mysql_mutex_assert_owner(&mutex);
try_LRU_scan= false;
if (!LRU_warned.test_and_set(std::memory_order_acquire))
sql_print_warning("InnoDB: Could not free any blocks in the buffer pool!"
" %zu blocks are in use and %zu free."
Expand Down

0 comments on commit ba69d81

Please sign in to comment.