summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-06-05 16:36:51 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-06-05 16:36:51 +0530
commitb4287ec3865d90920f0cc440c36f4873dcf51703 (patch)
treead687bc91f06e7e5dff9788d232fafd77b603af2
parent7906bee67bf3b9f9124da12dd1492d7b766bd53e (diff)
downloadmariadb-git-b4287ec3865d90920f0cc440c36f4873dcf51703.tar.gz
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.
-rw-r--r--storage/innobase/buf/buf0buf.cc4
-rw-r--r--storage/innobase/include/log0recv.h4
-rw-r--r--storage/innobase/log/log0recv.cc6
3 files changed, 8 insertions, 6 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 756caac1f54..18decb492f3 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -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);
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index 9bb54960058..03f6a6ff878 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -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 */
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index c0521f1dba4..dbce6f90fc2 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -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);