diff options
Diffstat (limited to 'storage/innobase/log/log0recv.cc')
-rw-r--r-- | storage/innobase/log/log0recv.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 9484901c90f..c3377ea284e 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -2212,6 +2212,35 @@ 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) +{ + ut_ad(srv_force_recovery); + mutex_enter(&recv_sys->mutex); + + if (!recv_sys->apply_log_recs) { + mutex_exit(&recv_sys->mutex); + return; + } + + recv_addr_t* recv_addr = recv_get_fil_addr_struct( + bpage->id.space(), bpage->id.page_no()); + + switch (recv_addr->state) { + case RECV_BEING_PROCESSED: + case RECV_PROCESSED: + break; + case RECV_WILL_NOT_READ: + ut_ad(0); + default: + recv_sys->n_addrs--; + } + + mutex_exit(&recv_sys->mutex); +} + /** Apply any buffered redo log to a page that was just read from a data file. @param[in,out] bpage buffer pool page */ void recv_recover_page(buf_page_t* bpage) |