mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
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.
This commit is contained in:
parent
25cc5e6b20
commit
1c6ee3c95c
1 changed files with 16 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue