diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-02-16 19:29:22 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-02-16 19:29:58 +0530 |
commit | d0cee0d0f9d37a647854ba8f29f705b947e6130e (patch) | |
tree | cc386da416f84d075f5c919314b80f3994714a34 | |
parent | 1146e98b3af3e2b15df0598a860f4571663a98d0 (diff) | |
download | mariadb-git-bb-10.6-MDEV-24863.tar.gz |
MDEV-24863 AHI entries mismatch with the index while reloading the evicted tables.bb-10.6-MDEV-24863
- InnoDB reloads the evicted table again from dictionary.
In that case, AHI entries and current index object mismatches
happens. When index object mismatches then InnoDB should drop
the page hash AHI entries for the block.
-rw-r--r-- | storage/innobase/btr/btr0sea.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index e29e4a35d72..8e4b5d6312f 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -705,6 +705,12 @@ btr_search_update_hash_ref( return; } + if (index != cursor->index) { + ut_ad(index->id == cursor->index->id); + btr_search_drop_page_hash_index(block); + return; + } + ut_ad(block->page.id().space() == index->table->space_id); ut_ad(index == cursor->index); ut_ad(!dict_index_is_ibuf(index)); @@ -1718,6 +1724,11 @@ btr_search_move_or_delete_hash_entries( return; } + if (index->freed()) { + btr_search_drop_page_hash_index(block); + return; + } + ahi_latch->rd_lock(SRW_LOCK_CALL); if (block->index) { @@ -1779,6 +1790,11 @@ void btr_search_update_hash_on_delete(btr_cur_t* cursor) return; } + if (index != cursor->index) { + btr_search_drop_page_hash_index(block); + return; + } + ut_ad(block->page.id().space() == index->table->space_id); ut_a(index == cursor->index); ut_a(block->curr_n_fields > 0 || block->curr_n_bytes > 0); @@ -1847,6 +1863,12 @@ void btr_search_update_hash_node_on_insert(btr_cur_t *cursor, return; } + if (index != cursor->index) { + ut_ad(index->id == cursor->index->id); + btr_search_drop_page_hash_index(block); + return; + } + ut_a(cursor->index == index); ut_ad(!dict_index_is_ibuf(index)); ahi_latch->wr_lock(SRW_LOCK_CALL); @@ -1933,6 +1955,12 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor, #ifdef MYSQL_INDEX_DISABLE_AHI ut_a(!index->disable_ahi); #endif + if (index != cursor->index) { + ut_ad(index->id == cursor->index->id); + btr_search_drop_page_hash_index(block); + return; + } + ut_a(index == cursor->index); ut_ad(!dict_index_is_ibuf(index)); |