Commit 466b2477 authored by marko's avatar marko

branches/zip: buf_LRU_invalidate_tablespace(): After freeing a

compressed-only page, restart the scan of the LRU list, because
prev_bpage may have been relocated.

buf_LRU_block_remove_hashed_page(): Note that other compressed pages
or compressed-only blocks may be relocated when freeing a compressed
page or a compressed-only block descriptor.
parent 46ea62d5
......@@ -51,7 +51,11 @@ ibool buf_lru_switched_on_innodb_mon = FALSE;
/**********************************************************************
Takes a block out of the LRU list and page hash table.
If the block is compressed-only (BUF_BLOCK_ZIP_PAGE),
the object will be freed and buf_pool->zip_mutex will be released. */
the object will be freed and buf_pool->zip_mutex will be released.
If a compressed page or a compressed-only block descriptor is freed,
other compressed pages or compressed-only block descriptors may be
relocated. */
static
enum buf_page_state
buf_LRU_block_remove_hashed_page(
......@@ -151,12 +155,18 @@ buf_LRU_invalidate_tablespace(
buf_LRU_block_free_hashed_page((buf_block_t*)
bpage);
} else {
goto next_page2;
/* The compressed block descriptor
(bpage) has been deallocated and
block_mutex released. Also,
buf_buddy_free() may have relocated
prev_bpage. Rescan the LRU list. */
bpage = UT_LIST_GET_LAST(buf_pool->LRU);
continue;
}
}
next_page:
mutex_exit(block_mutex);
next_page2:
bpage = prev_bpage;
}
......@@ -1066,7 +1076,11 @@ buf_LRU_block_free_non_file_page(
/**********************************************************************
Takes a block out of the LRU list and page hash table.
If the block is compressed-only (BUF_BLOCK_ZIP_PAGE),
the object will be freed and buf_pool->zip_mutex will be released. */
the object will be freed and buf_pool->zip_mutex will be released.
If a compressed page or a compressed-only block descriptor is freed,
other compressed pages or compressed-only block descriptors may be
relocated. */
static
enum buf_page_state
buf_LRU_block_remove_hashed_page(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment