mirror of
https://github.com/MariaDB/server.git
synced 2026-04-25 09:45:31 +02:00
Cleanup ibuf_page_exists(): Take simpler parameters
This commit is contained in:
parent
67c76704a8
commit
9869005201
4 changed files with 18 additions and 24 deletions
|
|
@ -4133,7 +4133,7 @@ evict_from_pool:
|
|||
buf_page_mutex_exit(block);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -5502,7 +5502,7 @@ release_page:
|
|||
|| !is_predefined_tablespace(bpage->id.space()))
|
||||
&& fil_page_get_type(frame) == FIL_PAGE_INDEX
|
||||
&& page_is_leaf(frame)
|
||||
&& ibuf_page_exists(*bpage)) {
|
||||
&& ibuf_page_exists(bpage->id, bpage->zip_size())) {
|
||||
bpage->ibuf_exist = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4176,24 +4176,17 @@ func_exit:
|
|||
}
|
||||
|
||||
/** 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 */
|
||||
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
|
||||
|| recv_recovery_is_on());
|
||||
ut_ad(!fsp_is_system_temporary(bpage.id.space()));
|
||||
ut_ad(buf_page_in_file(&bpage));
|
||||
ut_ad(buf_page_get_state(&bpage) != BUF_BLOCK_FILE_PAGE
|
||||
|| bpage.io_fix == BUF_IO_READ
|
||||
|| rw_lock_own(&const_cast<buf_block_t&>
|
||||
(reinterpret_cast<const buf_block_t&>
|
||||
(bpage)).lock, RW_LOCK_X));
|
||||
ut_ad(!fsp_is_system_temporary(id.space()));
|
||||
|
||||
const ulint physical_size = bpage.physical_size();
|
||||
const ulint physical_size = zip_size ? zip_size : srv_page_size;
|
||||
|
||||
if (ibuf_fixed_addr_page(bpage.id, physical_size)
|
||||
|| fsp_descr_page(bpage.id, physical_size)) {
|
||||
if (ibuf_fixed_addr_page(id, physical_size)
|
||||
|| fsp_descr_page(id, physical_size)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -4202,9 +4195,9 @@ bool ibuf_page_exists(const buf_page_t& bpage)
|
|||
|
||||
ibuf_mtr_start(&mtr);
|
||||
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_page->frame, bpage.id, bpage.zip_size(),
|
||||
bitmap_page->frame, id, zip_size,
|
||||
IBUF_BITMAP_BUFFERED, &mtr) != 0;
|
||||
}
|
||||
ibuf_mtr_commit(&mtr);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
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
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
@ -318,9 +318,10 @@ ibuf_insert(
|
|||
que_thr_t* thr);
|
||||
|
||||
/** 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 */
|
||||
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
|
||||
applies any buffered operations to the page and deletes the entries from the
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ public:
|
|||
}
|
||||
mutex_exit(&recv_sys.mutex);
|
||||
block->page.ibuf_exist = ibuf_page_exists(
|
||||
block->page);
|
||||
block->page.id, block->zip_size());
|
||||
mtr.commit();
|
||||
mtr.start();
|
||||
mutex_enter(&recv_sys.mutex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue