Commit f80deb95 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27868 buf_pool.flush_list is in the wrong order

buf_pool_t::insert_into_flush_list(): Remove any clean blocks
that the buf_pool.flush_list may contain ever since
commit 22b62eda (MDEV-25113).

This fixes up commit a635c406 (MDEV-27774).
parent 080676ca
...@@ -188,15 +188,33 @@ void buf_pool_t::insert_into_flush_list(buf_block_t *block, lsn_t lsn) noexcept ...@@ -188,15 +188,33 @@ void buf_pool_t::insert_into_flush_list(buf_block_t *block, lsn_t lsn) noexcept
MEM_CHECK_DEFINED(block->page.zip.data MEM_CHECK_DEFINED(block->page.zip.data
? block->page.zip.data : block->page.frame, ? block->page.zip.data : block->page.frame,
block->physical_size()); block->physical_size());
rescan:
if (buf_page_t *prev= UT_LIST_GET_FIRST(flush_list)) if (buf_page_t *prev= UT_LIST_GET_FIRST(flush_list))
{ {
if (prev->oldest_modification() <= lsn) lsn_t om= prev->oldest_modification();
if (om == 1)
{
delete_from_flush_list(prev);
goto rescan;
}
ut_ad(om > 2);
if (om <= lsn)
goto insert_first; goto insert_first;
while (buf_page_t *next= UT_LIST_GET_NEXT(list, prev)) while (buf_page_t *next= UT_LIST_GET_NEXT(list, prev))
if (next->oldest_modification() <= lsn) {
om= next->oldest_modification();
if (om == 1)
{
delete_from_flush_list(next);
continue;
}
ut_ad(om > 2);
if (om <= lsn)
break; break;
else else
prev= next; prev= next;
}
flush_hp.adjust(prev);
UT_LIST_INSERT_AFTER(flush_list, prev, &block->page); UT_LIST_INSERT_AFTER(flush_list, prev, &block->page);
} }
else else
......
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