mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
MDEV-26010: Assertion lsn > 2 failed in buf_pool_t::get_oldest_modification
In commit 22b62edaed (MDEV-25113)
we introduced a race condition. buf_LRU_free_page() would read
buf_page_t::oldest_modification() as 0 and assume that
buf_page_t::list can be used (for attaching the block to the
buf_pool.free list). In the observed race condition,
buf_pool_t::delete_from_flush_list() had cleared the field,
and buf_pool_t::delete_from_flush_list_low() was executing
concurrently with buf_LRU_block_free_non_file_page(),
which resulted in buf_pool.flush_list.end becoming corrupted.
buf_pool_t::delete_from_flush_list(), buf_flush_relocate_on_flush_list():
First remove the block from buf_pool.flush_list, and only then
invoke buf_page_t::clear_oldest_modification(), to ensure that
reading oldest_modification()==0 really implies that the block
no longer is in buf_pool.flush_list.
This commit is contained in:
parent
e329dc8d86
commit
5f22511e35
2 changed files with 7 additions and 6 deletions
|
|
@ -944,7 +944,7 @@ public:
|
|||
lsn_t oldest_modification() const { return oldest_modification_; }
|
||||
/** Set oldest_modification when adding to buf_pool.flush_list */
|
||||
inline void set_oldest_modification(lsn_t lsn);
|
||||
/** Clear oldest_modification when removing from buf_pool.flush_list */
|
||||
/** Clear oldest_modification after removing from buf_pool.flush_list */
|
||||
inline void clear_oldest_modification();
|
||||
/** Note that a block is no longer dirty, while not removing
|
||||
it from buf_pool.flush_list */
|
||||
|
|
@ -2246,10 +2246,11 @@ inline void buf_page_t::set_oldest_modification(lsn_t lsn)
|
|||
{
|
||||
mysql_mutex_assert_owner(&buf_pool.flush_list_mutex);
|
||||
ut_ad(oldest_modification() <= 1);
|
||||
ut_ad(lsn > 2);
|
||||
oldest_modification_= lsn;
|
||||
}
|
||||
|
||||
/** Clear oldest_modification when removing from buf_pool.flush_list */
|
||||
/** Clear oldest_modification after removing from buf_pool.flush_list */
|
||||
inline void buf_page_t::clear_oldest_modification()
|
||||
{
|
||||
mysql_mutex_assert_owner(&buf_pool.flush_list_mutex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue