MDEV-23380 InnoDB reads a page from disk despite parsing MLOG_INIT_FILE_PAGE2 record

This problem is caused by 6697135c
(MDEV-21572). During recovery, InnoDB prefetches the siblings of
change buffer index leaf page. It does asynchronous page read
and recovery scenario wasn't handled in buf_read_page_background().
It leads to the refusal of startup of the server.

Solution:
=========
  InnoDB shouldn't allow the change buffer index page siblings
to be prefetched.
parent 3e617b8b
...@@ -3145,7 +3145,7 @@ btr_cur_optimistic_insert( ...@@ -3145,7 +3145,7 @@ btr_cur_optimistic_insert(
/* prefetch siblings of the leaf for the pessimistic /* prefetch siblings of the leaf for the pessimistic
operation, if the page is leaf. */ operation, if the page is leaf. */
if (page_is_leaf(page)) { if (page_is_leaf(page) && !index->is_ibuf()) {
btr_cur_prefetch_siblings(block); btr_cur_prefetch_siblings(block);
} }
fail_err: fail_err:
...@@ -4041,6 +4041,7 @@ btr_cur_optimistic_update( ...@@ -4041,6 +4041,7 @@ btr_cur_optimistic_update(
if (rec_offs_any_extern(*offsets)) { if (rec_offs_any_extern(*offsets)) {
any_extern: any_extern:
ut_ad(!index->is_ibuf());
/* Externally stored fields are treated in pessimistic /* Externally stored fields are treated in pessimistic
update */ update */
...@@ -4220,7 +4221,7 @@ btr_cur_optimistic_update( ...@@ -4220,7 +4221,7 @@ btr_cur_optimistic_update(
} }
} }
if (err != DB_SUCCESS) { if (err != DB_SUCCESS && !index->is_ibuf()) {
/* prefetch siblings of the leaf for the pessimistic /* prefetch siblings of the leaf for the pessimistic
operation. */ operation. */
btr_cur_prefetch_siblings(block); btr_cur_prefetch_siblings(block);
......
...@@ -1034,6 +1034,9 @@ struct dict_index_t{ ...@@ -1034,6 +1034,9 @@ struct dict_index_t{
} }
} }
/** @return whether this is the change buffer */
bool is_ibuf() const { return UNIV_UNLIKELY(type & DICT_IBUF); }
#ifdef BTR_CUR_HASH_ADAPT #ifdef BTR_CUR_HASH_ADAPT
/** @return a clone of this */ /** @return a clone of this */
dict_index_t* clone() const; dict_index_t* clone() const;
......
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