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

Cleanup ibuf_page_exists(): Take simpler parameters

parent 67c76704
...@@ -4133,7 +4133,7 @@ buf_page_get_gen( ...@@ -4133,7 +4133,7 @@ buf_page_get_gen(
buf_page_mutex_exit(block); buf_page_mutex_exit(block);
if (!access_time && !recv_no_ibuf_operations if (!access_time && !recv_no_ibuf_operations
&& ibuf_page_exists(block->page)) { && ibuf_page_exists(block->page.id, zip_size)) {
block->page.ibuf_exist = true; block->page.ibuf_exist = true;
} }
...@@ -5502,7 +5502,7 @@ buf_page_io_complete(buf_page_t* bpage, bool dblwr, bool evict) ...@@ -5502,7 +5502,7 @@ buf_page_io_complete(buf_page_t* bpage, bool dblwr, bool evict)
|| !is_predefined_tablespace(bpage->id.space())) || !is_predefined_tablespace(bpage->id.space()))
&& fil_page_get_type(frame) == FIL_PAGE_INDEX && fil_page_get_type(frame) == FIL_PAGE_INDEX
&& page_is_leaf(frame) && page_is_leaf(frame)
&& ibuf_page_exists(*bpage)) { && ibuf_page_exists(bpage->id, bpage->zip_size())) {
bpage->ibuf_exist = true; bpage->ibuf_exist = true;
} }
......
...@@ -4176,24 +4176,17 @@ bool ibuf_delete_rec(ulint space, ulint page_no, btr_pcur_t* pcur, ...@@ -4176,24 +4176,17 @@ bool ibuf_delete_rec(ulint space, ulint page_no, btr_pcur_t* pcur,
} }
/** Check whether buffered changes exist for a page. /** Check whether buffered changes exist for a page.
@param[in,out] block page @param[in] id page identifier
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
@return whether buffered changes exist */ @return whether buffered changes exist */
bool ibuf_page_exists(const buf_page_t& bpage) bool ibuf_page_exists(const page_id_t id, ulint zip_size)
{ {
ut_ad(buf_page_get_io_fix(&bpage) == BUF_IO_READ ut_ad(!fsp_is_system_temporary(id.space()));
|| recv_recovery_is_on());
ut_ad(!fsp_is_system_temporary(bpage.id.space())); const ulint physical_size = zip_size ? zip_size : srv_page_size;
ut_ad(buf_page_in_file(&bpage));
ut_ad(buf_page_get_state(&bpage) != BUF_BLOCK_FILE_PAGE if (ibuf_fixed_addr_page(id, physical_size)
|| bpage.io_fix == BUF_IO_READ || fsp_descr_page(id, physical_size)) {
|| rw_lock_own(&const_cast<buf_block_t&>
(reinterpret_cast<const buf_block_t&>
(bpage)).lock, RW_LOCK_X));
const ulint physical_size = bpage.physical_size();
if (ibuf_fixed_addr_page(bpage.id, physical_size)
|| fsp_descr_page(bpage.id, physical_size)) {
return false; return false;
} }
...@@ -4202,9 +4195,9 @@ bool ibuf_page_exists(const buf_page_t& bpage) ...@@ -4202,9 +4195,9 @@ bool ibuf_page_exists(const buf_page_t& bpage)
ibuf_mtr_start(&mtr); ibuf_mtr_start(&mtr);
if (const buf_block_t* bitmap_page = ibuf_bitmap_get_map_page( if (const buf_block_t* bitmap_page = ibuf_bitmap_get_map_page(
bpage.id, bpage.zip_size(), &mtr)) { id, zip_size, &mtr)) {
bitmap_bits = ibuf_bitmap_page_get_bits( bitmap_bits = ibuf_bitmap_page_get_bits(
bitmap_page->frame, bpage.id, bpage.zip_size(), bitmap_page->frame, id, zip_size,
IBUF_BITMAP_BUFFERED, &mtr) != 0; IBUF_BITMAP_BUFFERED, &mtr) != 0;
} }
ibuf_mtr_commit(&mtr); ibuf_mtr_commit(&mtr);
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2019, MariaDB Corporation. Copyright (c) 2016, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -318,9 +318,10 @@ ibuf_insert( ...@@ -318,9 +318,10 @@ ibuf_insert(
que_thr_t* thr); que_thr_t* thr);
/** Check whether buffered changes exist for a page. /** Check whether buffered changes exist for a page.
@param[in,out] bpage buffer page @param[in] id page identifier
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
@return whether buffered changes exist */ @return whether buffered changes exist */
bool ibuf_page_exists(const buf_page_t& bpage); bool ibuf_page_exists(const page_id_t id, ulint zip_size);
/** When an index page is read from a disk to the buffer pool, this function /** When an index page is read from a disk to the buffer pool, this function
applies any buffered operations to the page and deletes the entries from the applies any buffered operations to the page and deletes the entries from the
......
...@@ -328,7 +328,7 @@ class mlog_init_t ...@@ -328,7 +328,7 @@ class mlog_init_t
} }
mutex_exit(&recv_sys.mutex); mutex_exit(&recv_sys.mutex);
block->page.ibuf_exist = ibuf_page_exists( block->page.ibuf_exist = ibuf_page_exists(
block->page); block->page.id, block->zip_size());
mtr.commit(); mtr.commit();
mtr.start(); mtr.start();
mutex_enter(&recv_sys.mutex); mutex_enter(&recv_sys.mutex);
......
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