Skip to content
Permalink
Browse files
MDEV-19514 fixup: Optimize ibuf_merge_or_delete_for_page() calls
  • Loading branch information
dr-m committed May 31, 2021
1 parent 601eb41 commit 6ca0654
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
@@ -3812,7 +3812,8 @@ buf_page_create(fil_space_t *space, uint32_t offset,

/* Delete possible entries for the page from the insert buffer:
such can exist if the page belonged to an index which was dropped */
if (!recv_recovery_is_on())
if (page_id < page_id_t{SRV_SPACE_ID_UPPER_BOUND, 0} &&
!recv_recovery_is_on())
ibuf_merge_or_delete_for_page(nullptr, page_id, zip_size);

static_assert(FIL_PAGE_PREV + 4 == FIL_PAGE_NEXT, "adjacent");
@@ -4203,6 +4203,10 @@ subsequently was dropped.
void ibuf_merge_or_delete_for_page(buf_block_t *block, const page_id_t page_id,
ulint zip_size)
{
if (trx_sys_hdr_page(page_id)) {
return;
}

btr_pcur_t pcur;
#ifdef UNIV_IBUF_DEBUG
ulint volume = 0;
@@ -4217,11 +4221,8 @@ void ibuf_merge_or_delete_for_page(buf_block_t *block, const page_id_t page_id,
ut_ad(!block || page_id == block->page.id());
ut_ad(!block || block->page.state() == BUF_BLOCK_FILE_PAGE);
ut_ad(!block || block->page.status == buf_page_t::NORMAL);

if (trx_sys_hdr_page(page_id)
|| fsp_is_system_temporary(page_id.space())) {
return;
}
ut_ad(!trx_sys_hdr_page(page_id));
ut_ad(page_id < page_id_t(SRV_SPACE_ID_UPPER_BOUND, 0));

const ulint physical_size = zip_size ? zip_size : srv_page_size;

0 comments on commit 6ca0654

Please sign in to comment.