summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-01-14 17:42:19 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-01-14 17:42:19 +0200
commitc104a01b5028d79f9b434a6e0e6748bee405dc67 (patch)
tree9e3db503996ad830cfac0a62f75e5bddefba840c
parent6831b3f2a0fd656fb41dd9df5f141431988448f1 (diff)
downloadmariadb-git-c104a01b5028d79f9b434a6e0e6748bee405dc67.tar.gz
MDEV-27500 buf_page_free() fails to drop the adaptive hash index
The function buf_page_free() that was introduced in commit a35b4ae89871d8184f04abb112c385481d557dbb (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 aaef2e1d8c843d1e40b1ce0c5199c3abb3c5da28 in the 10.6 branch. Thanks to Matthias Leich for finding the bug and testing the fix.
-rw-r--r--storage/innobase/buf/buf0buf.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 37f99a94cee..5a49757e857 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -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;
}