diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index b2e58ca0cc0..d82a753899e 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1786,8 +1786,9 @@ static ulint buf_flush_LRU_list_batch(buf_pool_t *buf_pool, ulint max) { } } else { auto acquired = mutex_enter_nowait(block_mutex) == 0; - - if (acquired && buf_flush_ready_for_replace(bpage)) { + if (acquired && bpage->get_io_fix() != BUF_IO_NONE) { + mutex_exit(block_mutex); + } else if (acquired && buf_flush_ready_for_replace(bpage)) { /* block is ready for eviction i.e., it is clean and is not IO-fixed or buffer fixed. */ if (buf_LRU_free_page(bpage, true)) { @@ -2178,7 +2179,11 @@ bool buf_flush_single_page_from_LRU(buf_pool_t *buf_pool) { mutex_enter(block_mutex); - if (buf_flush_ready_for_replace(bpage)) { + if (bpage->get_io_fix() != BUF_IO_NONE) { + + mutex_exit(block_mutex); + + } else if (buf_flush_ready_for_replace(bpage)) { /* block is ready for eviction i.e., it is clean and is not IO-fixed or buffer fixed. */