IF you set innodb_lazy_drop_table = 1, DROP TABLE "fil_delete_tablespace" will call buf_LRU_mark_space_was_deleted() to mark all pages of tablespace_id=your_drop_tablespace_id with "bpage->space_was_being_deleted = TRUE;".
And this operation will get "btr_search_latch"
rw_lock_s_lock(&btr_search_latch);
chunk = buf_pool->chunks;
for (i = buf_pool->n_chunks; i--; chunk++) { buf_block_t* block = chunk->blocks;
for (j = chunk->size; j--; block++) {
if (buf_block_get_state(block)
!= BUF_BLOCK_FILE_PAGE
|| !block->is_hashed
|| buf_page_get_space(&block->page) != id) { continue;
}
And in "dict_index_remove_from_cache" will call "btr_search_drop_page_hash_index_on_index()", this function must get rw_lock_x_lock(&btr_search_latch) to remove hash index page let index->search_info->ref_count--.
So, I thing this is the reason.
If this operation lock by "rw_lock_x_lock(&btr_search_latch);", then
IF you set innodb_ lazy_drop_ table = 1, DROP TABLE "fil_delete_ tablespace" will call buf_LRU_ mark_space_ was_deleted( ) to mark all pages of tablespace_ id=your_ drop_tablespace _id with "bpage- >space_ was_being_ deleted = TRUE;".
And this operation will get "btr_search_latch"
rw_ lock_s_ lock(&btr_ search_ latch);
buf_block_ t* block = chunk->blocks; get_state( block) get_space( &block- >page) != id) {
continue;
chunk = buf_pool->chunks;
for (i = buf_pool->n_chunks; i--; chunk++) {
for (j = chunk->size; j--; block++) {
if (buf_block_
!= BUF_BLOCK_FILE_PAGE
|| !block->is_hashed
|| buf_page_
}
}
}
rw_
And in "dict_index_ remove_ from_cache" will call "btr_search_ drop_page_ hash_index_ on_index( )", this function must get rw_lock_ x_lock( &btr_search_ latch) to remove hash index page let index-> search_ info->ref_ count-- .
So, I thing this is the reason.
If this operation lock by "rw_lock_ x_lock( &btr_search_ latch); ", then