Comment 6 for bug 897258

Revision history for this message
Lixun Peng (P.Linux) (plx) wrote :

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;
            }

            rw_lock_s_unlock(&btr_search_latch);

            rw_lock_x_lock(&block->lock);
            btr_search_drop_page_hash_index(block);
            rw_lock_x_unlock(&block->lock);

            rw_lock_s_lock(&btr_search_latch);
        }
    }
    rw_lock_s_unlock(&btr_search_latch);

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