Skip to content

Commit

Permalink
MDEV-27500 buf_page_free() fails to drop the adaptive hash index
Browse files Browse the repository at this point in the history
The function buf_page_free() that was introduced
in commit a35b4ae (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 aaef2e1
in the 10.6 branch.

Thanks to Matthias Leich for finding the bug and testing the fix.
  • Loading branch information
dr-m committed Jan 14, 2022
1 parent 6831b3f commit c104a01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion storage/innobase/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c104a01

Please sign in to comment.