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

MDEV-19514 fixup: Simplify buf_page_read_complete()

False positives for buf_page_t::ibuf_exist are acceptable,
because it does not hurt to unnecessarily invoke
ibuf_merge_or_delete_for_page().

Invoking buf_page_get_gen() in a read completion function
is a definite no-no, because it could trigger a page flush
or cause the server to run out of buffer pool.

With some MDEV-23855 changes present, the test innodb.purge_secondary
occasionally failed due to the table having been dropped while
ibuf_page_exists() invoked buf_page_get_gen().

Reviewed by: Thirunarayanan Balathandayuthapani
parent 7cffb5f6
...@@ -4325,7 +4325,7 @@ dberr_t buf_page_read_complete(buf_page_t *bpage, const fil_node_t &node) ...@@ -4325,7 +4325,7 @@ dberr_t buf_page_read_complete(buf_page_t *bpage, const fil_node_t &node)
if (bpage->state() == BUF_BLOCK_FILE_PAGE && !recv_no_ibuf_operations && if (bpage->state() == BUF_BLOCK_FILE_PAGE && !recv_no_ibuf_operations &&
(!id.space() || !is_predefined_tablespace(id.space())) && (!id.space() || !is_predefined_tablespace(id.space())) &&
fil_page_get_type(frame) == FIL_PAGE_INDEX && fil_page_get_type(frame) == FIL_PAGE_INDEX &&
page_is_leaf(frame) && ibuf_page_exists(id, bpage->zip_size())) page_is_leaf(frame))
bpage->ibuf_exist= true; bpage->ibuf_exist= true;
if (UNIV_UNLIKELY(MONITOR_IS_ON(MONITOR_MODULE_BUF_PAGE))) if (UNIV_UNLIKELY(MONITOR_IS_ON(MONITOR_MODULE_BUF_PAGE)))
......
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