diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-02-17 19:38:17 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-02-17 19:38:17 +0200 |
commit | f80deb9590775af44da200920ee9ac662e93205d (patch) | |
tree | 446b7fc4857af3cd30cdeb72657c617f43ef18c2 | |
parent | 080676ca51e0f9f6684277acf9d7f54368987b47 (diff) | |
download | mariadb-git-f80deb9590775af44da200920ee9ac662e93205d.tar.gz |
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 22b62edaedddb1cabd5b855cdd39a5e90a5695a2 (MDEV-25113).
This fixes up commit a635c40648519fd6c3729c9657872a16a0a20821 (MDEV-27774).
-rw-r--r-- | storage/innobase/buf/buf0flu.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 220997758e9..e1689dc83fb 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -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 ? block->page.zip.data : block->page.frame, block->physical_size()); +rescan: 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; 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; else prev= next; + } + flush_hp.adjust(prev); UT_LIST_INSERT_AFTER(flush_list, prev, &block->page); } else |