MDEV-23452 Assertion `buf_page_get_io_fix(bpage) == BUF_IO_NONE' failed

			in buf_page_set_sticky

commit a1f899a8 (MDEV-23233) added the
code to make page sticky. So that InnoDB can't allow the page to
be grabbed by other thread while doing lazy drop of ahi.

But the block could be in flush list and it could have io_fix value
as BUF_IO_WRITE. It could lead to the failure in buf_page_set_sticky().

buf_page_create(): If btr_search_drop_page_hash_index() must be invoked,
take x-latch on the block. If the block io_fix value is other than
BUF_IO_NONE, release the buffer pool mutex and page hash lock and
wait for I/O to complete.
parent 22c4a751
......@@ -5591,7 +5591,21 @@ buf_page_create(
if (drop_hash_entry) {
mutex_enter(&block->mutex);
buf_page_set_sticky(&block->page);
/* Avoid a hang if I/O is going on. Release
the buffer pool mutex and page hash lock
and wait for I/O to complete */
while (buf_block_get_io_fix(block) != BUF_IO_NONE) {
buf_block_fix(block);
mutex_exit(&block->mutex);
buf_pool_mutex_exit(buf_pool);
rw_lock_x_unlock(hash_lock);
buf_pool_mutex_enter(buf_pool);
rw_lock_x_lock(hash_lock);
mutex_enter(&block->mutex);
buf_block_unfix(block);
}
rw_lock_x_lock(&block->lock);
mutex_exit(&block->mutex);
}
#endif
......@@ -5603,11 +5617,7 @@ buf_page_create(
#ifdef BTR_CUR_HASH_ADAPT
if (drop_hash_entry) {
btr_search_drop_page_hash_index(block);
buf_pool_mutex_enter(buf_pool);
mutex_enter(&block->mutex);
buf_page_unset_sticky(&block->page);
mutex_exit(&block->mutex);
buf_pool_mutex_exit(buf_pool);
rw_lock_x_unlock(&block->lock);
}
#endif /* BTR_CUR_HASH_ADAPT */
......
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