• Marko Mäkelä's avatar
    MDEV-22871: Clean up hash_table_t · 9159b897
    Marko Mäkelä authored
    HASH_TABLE_SYNC_MUTEX was kind-of used for the adaptive hash index,
    even though that hash table is already protected by btr_search_latches[].
    
    HASH_TABLE_SYNC_RWLOCK was only being used for buf_pool.page_hash.
    It is cleaner to decouple that synchronization from hash_table_t,
    and move it to the actual user.
    
    buf_pool_t::page_hash_latches[]: Synchronization for buf_pool.page_hash.
    
    LATCH_ID_HASH_TABLE_MUTEX: Remove.
    
    hash_table_t::sync_obj, hash_table_t::n_sync_obj: Remove.
    
    hash_table_t::type, hash_table_sync_t: Remove.
    
    HASH_ASSERT_OWN(), hash_get_mutex(), hash_get_nth_mutex(): Remove.
    
    ib_recreate(): Merge to the only caller, buf_pool_resize_hash().
    
    ib_create(): Merge to the callers.
    
    ha_clear(): Merge to the only caller buf_pool_t::close().
    
    buf_pool_t::create(): Merge the ib_create() and
    hash_create_sync_obj() invocations.
    
    ha_insert_for_fold_func(): Clarify an assertion.
    
    buf_pool_t::page_hash_lock(): Simplify the logic.
    
    hash_assert_can_search(), hash_assert_can_modify(): Remove.
    These predicates were only being invoked for the adaptive hash index,
    while they only are effective for buf_pool.page_hash.
    
    HASH_DELETE_AND_COMPACT(): Merge to ha_delete_hash_node().
    
    hash_get_sync_obj_index(): Remove.
    
    hash_table_t::heaps[], hash_get_nth_heap(): Remove. It was actually unused!
    
    hash_get_heap(): Remove. It was only used in ha_delete_hash_node(),
    where we always use hash_table_t::heap.
    
    hash_table_t::calc_hash(): Replaces hash_calc_hash().
    9159b897
sync0debug.cc 42.5 KB