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

MDEV-27500 buf_page_free() fails to drop the adaptive hash index

The function buf_page_free() that was introduced
in commit a35b4ae8 (MDEV-15528)
failed to remove any adaptive hash index entries for the page
before freeing the page.

This caused an assertion failure on shutdown of 10.6 server of
in the function buf_pool_t::clear_hash_index() with the expression:
(s >= buf_page_t::UNFIXED || s == buf_page_t::REMOVE_HASH).
The assertion would fail for a block that is in the freed state.

The failing assertion was added in
commit aaef2e1d
in the 10.6 branch.

Thanks to Matthias Leich for finding the bug and testing the fix.
parent 6831b3f2
......@@ -2,7 +2,7 @@
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2013, 2021, MariaDB Corporation.
Copyright (c) 2013, 2022, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -2500,6 +2500,11 @@ void buf_page_free(fil_space_t *space, uint32_t page, mtr_t *mtr,
rw_lock_x_lock_inline(&block->lock, 0, file, line);
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
#ifdef BTR_CUR_HASH_ADAPT
if (block->index)
btr_search_drop_page_hash_index(block);
#endif /* BTR_CUR_HASH_ADAPT */
block->page.status= buf_page_t::FREED;
return;
}
......
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