diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-04 12:29:32 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-05 15:22:46 +0300 |
commit | 138c11cce59304ba67b9229d267eef1503a968fd (patch) | |
tree | db59ee44c8013fbafa1893428ec94d5ac045e36b /mysql-test/main/win.test | |
parent | 3677dd5cb438e7b3ddb46a547f36fc2691c031a9 (diff) | |
download | mariadb-git-138c11cce59304ba67b9229d267eef1503a968fd.tar.gz |
MDEV-22790 Race between btr_page_mtr_lock() dropping AHI on the same block
This race condition was introduced by
commit ad6171b91cac33e70bb28fa6865488b2c65e858c (MDEV-22456).
In the observed case, two threads were executing
btr_search_drop_page_hash_index() on the same block,
to free a stale entry that was attached to a dropped index.
Both threads were holding an S latch on the block.
We must prevent the double-free of block->index by holding
block->lock in exclusive mode.
btr_search_guess_on_hash(): Do not invoke
btr_search_drop_page_hash_index(block) to get rid of
stale entries, because we are not necessarily holding
an exclusive block->lock here.
buf_defer_drop_ahi(): New function, to safely drop stale
entries in buf_page_mtr_lock(). We will skip the call to
btr_search_drop_page_hash_index(block) when only requesting
bufferfixing (no page latch), because in that case, we should
not be accessing the adaptive hash index, and we might get
a deadlock if we acquired the page latch.
Diffstat (limited to 'mysql-test/main/win.test')
0 files changed, 0 insertions, 0 deletions