diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2023-02-14 14:36:17 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2023-02-14 14:36:17 +0530 |
commit | 1a5c7552ea3a0233e7abff56a167c3a532c7da0a (patch) | |
tree | b3d807d67767efe8067b86af289fe9ee9ddd13d3 /storage | |
parent | 3eea2e8e10b6d8f5280e40478dcaac8961b74de4 (diff) | |
download | mariadb-git-1a5c7552ea3a0233e7abff56a167c3a532c7da0a.tar.gz |
MDEV-30552 InnoDB recovery crashes when error handling scenario
- InnoDB fails to reset the after_apply variable before applying
the redo log in last batch during multi-batch recovery.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/ibuf/ibuf0ibuf.cc | 4 | ||||
-rw-r--r-- | storage/innobase/log/log0recv.cc | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index d88c2b0027e..dff0ad57057 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -450,6 +450,10 @@ err_exit: root = buf_block_get_frame(block); } + DBUG_EXECUTE_IF("ibuf_init_corrupt", + err = DB_CORRUPTION; + goto err_exit;); + if (page_is_comp(root) || fil_page_get_type(root) != FIL_PAGE_INDEX || btr_page_get_index_id(root) != DICT_IBUF_ID_MIN) { err = DB_CORRUPTION; diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index eb2931adf0e..9b4ceb4f03e 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -3642,6 +3642,11 @@ completed: mysql_mutex_unlock(&log_sys.mutex); return(DB_ERROR); } + + /* In case of multi-batch recovery, + redo log for the last batch is not + applied yet. */ + ut_d(recv_sys.after_apply = false); } } else { ut_ad(!rescan || recv_sys.pages.empty()); |