MDEV-19541 InnoDB crashes when trying to recover a corrupted page

- Use corrupt page id instead of whole block after releasing it from
LRU list.
parent 7906bee6
......@@ -6051,10 +6051,12 @@ buf_page_io_complete(buf_page_t* bpage, bool dblwr, bool evict)
if (err == DB_PAGE_CORRUPTED
|| err == DB_DECRYPTION_FAILED) {
const page_id_t corrupt_page_id = bpage->id;
buf_corrupt_page_release(bpage, space);
if (recv_recovery_is_on()) {
recv_recover_corrupt_page(bpage);
recv_recover_corrupt_page(corrupt_page_id);
}
fil_space_release_for_io(space);
......
......@@ -51,8 +51,8 @@ recv_find_max_checkpoint(ulint* max_field)
/** Reduces recv_sys->n_addrs for the corrupted page.
This function should called when srv_force_recovery > 0.
@param[in] bpage buffer pool page */
void recv_recover_corrupt_page(buf_page_t* bpage);
@param[in] page_id page id of the corrupted page */
void recv_recover_corrupt_page(page_id_t page_id);
/** Apply any buffered redo log to a page that was just read from a data file.
@param[in,out] bpage buffer pool page */
......
......@@ -2214,8 +2214,8 @@ static void recv_recover_page(buf_block_t* block, mtr_t& mtr,
/** Reduces recv_sys->n_addrs for the corrupted page.
This function should called when srv_force_recovery > 0.
@param[in] bpage buffer pool page */
void recv_recover_corrupt_page(buf_page_t* bpage)
@param[in] page_id page id of the corrupted page */
void recv_recover_corrupt_page(page_id_t page_id)
{
ut_ad(srv_force_recovery);
mutex_enter(&recv_sys->mutex);
......@@ -2226,7 +2226,7 @@ void recv_recover_corrupt_page(buf_page_t* bpage)
}
recv_addr_t* recv_addr = recv_get_fil_addr_struct(
bpage->id.space(), bpage->id.page_no());
page_id.space(), page_id.page_no());
ut_ad(recv_addr->state != RECV_WILL_NOT_READ);
......
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