Commit 1e13dd0b authored by mmakela's avatar mmakela

branches/innodb+: buf_flush_insert_sorted_into_flush_list(): Restore ut_ad()

assertions that were removed when introducing the flush list mutex,
and add comments that explain why these assertions are valid.

Discussed with Inaam Rana.
parent f4608014
......@@ -280,6 +280,22 @@ buf_flush_insert_sorted_into_flush_list(
buf_flush_list_mutex_enter();
/* The field in_LRU_list is protected by buf_pool_mutex, which
we are not holding. However, while a block is in the flush
list, it is dirty and cannot be discarded, not from the
page_hash or from the LRU list. At most, the uncompressed
page frame of a compressed block may be discarded or created
(copying the block->page to or from a buf_page_t that is
dynamically allocated from buf_buddy_alloc()). Because those
transitions hold block->mutex and the flush list mutex (via
buf_flush_relocate_on_flush_list()), there is no possibility
of a race condition in the assertions below. */
ut_ad(block->page.in_LRU_list);
ut_ad(block->page.in_page_hash);
/* buf_buddy_block_register() will take a block in the
BUF_BLOCK_MEMORY state, not a file page. */
ut_ad(!block->page.in_zip_hash);
ut_ad(!block->page.in_flush_list);
ut_d(block->page.in_flush_list = TRUE);
block->page.oldest_modification = lsn;
......
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