位置: IT常识 - 正文
推荐整理分享mysql InnoDB的崩溃恢复过程(mysql崩溃日志),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:mysql崩溃日志,mysql崩溃 recovery,mysql总是崩溃,mysql 崩溃恢复全过程,mysql数据库崩溃时事务恢复机制,mysql崩溃 recovery,mysql 崩溃恢复全过程,mysql崩溃原因,内容如对您有帮助,希望把文章链接给更多的朋友!
364
1、redo log操作:保证已提交事务影响的最新数据刷到数据页里。
2、undo log操作:保证未提交事务影响的数据页回滚。
3、写缓冲(change buffer)合并。
4、purge操作。
InnoDB的一种垃圾收集机制,使用单独的后台线程周期性处理索引中标记删除的数据。
实例
/*LookforMLOG_CHECKPOINT.*/recv_group_scan_log_recs(group,&contiguous_lsn,false);/*Thefirstscanshouldnothavestoredorappliedanyrecords.*/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()<<"Ignoringtheredologduetomissing""MLOG_CHECKPOINTbetweenthecheckpoint"<<checkpoint_lsn<<"andtheend"<<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:wealwaysdoa'recovery'atstartup,butonlyifthereissomethingwrongwewillprintamessagetotheuseraboutrecovery:*/if(checkpoint_lsn!=flush_lsn){if(checkpoint_lsn+SIZE_OF_MLOG_CHECKPOINT<flush_lsn){ib::warn()<<"Areyousureyouareusingthe""rightib_logfilestostartupthedatabase?""Logsequencenumberintheib_logfilesis"<<checkpoint_lsn<<",lessthanthe""logsequencenumberinthefirstsystem""tablespacefileheader,"<<flush_lsn<<".";if(!recv_needed_recovery){ib::info()<<"Thelogsequencenumber"<<flush_lsn<<"inthesystemtablespacedoesnotmatch""thelogsequencenumber"<<checkpoint_lsn<<"intheib_logfiles!";if(srv_read_only_mode){ib::error()<<"Can'tinitiatedatabase""recovery,runninginread-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的崩溃恢复过程,希望对大家有所帮助。更多mysql学习指路:MySQL
上一篇:帝国cms怎么整合ckplayer6.1(帝国cms怎么用)
下一篇:Linux端文件清理的Python脚本实现(linux清理文件内容)
友情链接: 武汉网站建设