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.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2019-06-05 16:36:51 +05:30
parent 7906bee67b
commit b4287ec386
3 changed files with 8 additions and 6 deletions

View file

@ -6051,10 +6051,12 @@ database_corrupted:
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);

View file

@ -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 */

View file

@ -2214,8 +2214,8 @@ skip_log:
/** 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);