您好,登錄后才能下訂單哦!
本篇內容介紹了“mysql InnoDB的崩潰恢復過程是什么”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
1、redo log操作:保證已提交事務影響的最新數據刷到數據頁里。
2、undo log操作:保證未提交事務影響的數據頁回滾。
3、寫緩沖(change buffer)合并。
4、purge操作。
InnoDB的一種垃圾收集機制,使用單獨的后臺線程周期性處理索引中標記刪除的數據。
實例
/* Look for MLOG_CHECKPOINT. */ recv_group_scan_log_recs(group, &contiguous_lsn, false); /* The first scan should not have stored or applied any records. */ ut_ad(recv_sys->n_addrs == 0); ut_ad(!recv_sys->found_corrupt_fs); if (recv_sys->found_corrupt_log && !srv_force_recovery) { log_mutex_exit(); return(DB_ERROR); } if (recv_sys->mlog_checkpoint_lsn == 0) { if (!srv_read_only_mode && group->scanned_lsn != checkpoint_lsn) { ib::error() << "Ignoring the redo log due to missing" " MLOG_CHECKPOINT between the checkpoint " << checkpoint_lsn << " and the end " << group->scanned_lsn << "."; if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { log_mutex_exit(); return(DB_ERROR); } } group->scanned_lsn = checkpoint_lsn; rescan = false; } else { contiguous_lsn = checkpoint_lsn; rescan = recv_group_scan_log_recs( group, &contiguous_lsn, false); if ((recv_sys->found_corrupt_log && !srv_force_recovery) || recv_sys->found_corrupt_fs) { log_mutex_exit(); return(DB_ERROR); } } /* NOTE: we always do a 'recovery' at startup, but only if there is something wrong we will print a message to the user about recovery: */ if (checkpoint_lsn != flush_lsn) { if (checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT < flush_lsn) { ib::warn() << " Are you sure you are using the" " right ib_logfiles to start up the database?" " Log sequence number in the ib_logfiles is " << checkpoint_lsn << ", less than the" " log sequence number in the first system" " tablespace file header, " << flush_lsn << "."; } if (!recv_needed_recovery) { ib::info() << "The log sequence number " << flush_lsn << " in the system tablespace does not match" " the log sequence number " << checkpoint_lsn << " in the ib_logfiles!"; if (srv_read_only_mode) { ib::error() << "Can't initiate database" " recovery, running in read-only-mode."; log_mutex_exit(); return(DB_READ_ONLY); } recv_init_crash_recovery(); } } log_sys->lsn = recv_sys->recovered_lsn; if (recv_needed_recovery) { err = recv_init_crash_recovery_spaces(); if (err != DB_SUCCESS) { log_mutex_exit(); return(err); } if (rescan) { contiguous_lsn = checkpoint_lsn; recv_group_scan_log_recs(group, &contiguous_lsn, true); if ((recv_sys->found_corrupt_log && !srv_force_recovery) || recv_sys->found_corrupt_fs) { log_mutex_exit(); return(DB_ERROR); } } } else { ut_ad(!rescan || recv_sys->n_addrs == 0); }
“mysql InnoDB的崩潰恢復過程是什么”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。