MDEV-24659 Assertion !fsp_is_system_temporary(bpage->id().space()) failed in buf_flush_relocate_on_flush_list()

When commit 5eb539555b (MDEV-12227)
removed the pages of temporary tables from the buf_pool.flush_list,
an adjustment to the buffer pool resizing was forgotten.

buf_pool_t::realloc(): Do not invoke buf_flush_relocate_on_flush_list()
for pages that belong to the temporary tablespace. Also, deduplicate
some code at the end.

buf_page_t::set_corrupt_id(): Tolerate oldest_modification()==1
(the dummy value) for temporary tablespace pages. The revised
buf_pool_t::realloc() may invoke this on dirty temporary tablespace pages.
This commit is contained in:
Marko Mäkelä 2021-01-23 17:45:03 +02:00
commit 84b8f529c7
4 changed files with 66 additions and 13 deletions

View file

@ -2,7 +2,7 @@
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2013, 2020, MariaDB Corporation.
Copyright (c) 2013, 2021, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@ -1624,8 +1624,10 @@ inline bool buf_pool_t::realloc(buf_block_t *block)
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 0xff, 4);
MEM_UNDEFINED(block->frame, srv_page_size);
block->page.set_state(BUF_BLOCK_REMOVE_HASH);
buf_flush_relocate_on_flush_list(&block->page,
&new_block->page);
if (!fsp_is_system_temporary(id.space())) {
buf_flush_relocate_on_flush_list(&block->page,
&new_block->page);
}
block->page.set_corrupt_id();
/* set other flags of buf_block_t */
@ -1641,17 +1643,13 @@ inline bool buf_pool_t::realloc(buf_block_t *block)
new_block->n_fields = 1;
new_block->left_side = TRUE;
#endif /* BTR_CUR_HASH_ADAPT */
hash_lock->write_unlock();
/* free block */
ut_d(block->page.set_state(BUF_BLOCK_MEMORY));
buf_LRU_block_free_non_file_page(block);
} else {
hash_lock->write_unlock();
buf_LRU_block_free_non_file_page(new_block);
/* free block */
new_block = block;
}
hash_lock->write_unlock();
buf_LRU_block_free_non_file_page(new_block);
return(true); /* free_list was enough */
}