1、redo log操作:保证已提交事务影响的最新数据刷到数据页里。
2、undo log操作:保证未提交事务影响的数据页回滚。文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
3、写缓冲(change buffer)合并。文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
4、purge操作。文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
InnoDB的一种垃圾收集机制,使用单独的后台线程周期性处理索引中标记删除的数据。文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
实例文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
/*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,butonlyif
thereissomethingwrongwewillprintamessagetothe
useraboutrecovery:*/
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的崩溃恢复过程,希望对大家有所帮助文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
文章源自飞鸟学习网-https://www.pk88.net/2022-0301-14.html
全站资源源于网络整合,仅供学习研究,不可商用,不提供技术指导,如有侵权请告知删除,可以投稿,广告合作联系V: pk88net
继续阅读
我的微信
微信号已复制
我的微信
微信扫一扫

