mysql Innodb在发生意外宕机,重启之后,要经历哪些过程,以下是详细过程。

• Tablespace discovery

Tablespace discovery is the process that InnoDB uses to identify tablespaces that require redo log application. See Tablespace Discovery During Crash Recovery.

• Redo log application

Redo log application is performed during initialization, before accepting any connections. If all changes are flushed from the buffer pool to the tablespaces (ibdata* and *.ibd files) at the time of the shutdown or crash, redo log application is skipped. InnoDB also skips redo log application if redo log files are missing at startup.

Removing redo logs to speed up recovery is not recommended, even if some data loss is acceptable.Removing redo logs should only be considered after a clean shutdown, with innodb_fast_shutdown set to 0 or 1.

For information about the process that InnoDB uses to identify tablespaces that require redo log application, see Tablespace Discovery During Crash Recovery.

• Roll back of incomplete transactions

Incomplete transactions are any transactions that were active at the time of crash or fast shutdown.

The time it takes to roll back an incomplete transaction can be three or four times the amount of time a

transaction is active before it is interrupted, depending on server load.

You cannot cancel transactions that are being rolled back. In extreme cases, when rolling back

transactions is expected to take an exceptionally long time, it may be faster to start InnoDB with an

innodb_force_recovery setting of 3 or greater. See Section 15.21.2, “Forcing InnoDB Recovery”.

• Change buffer merge

Applying changes from the change buffer (part of the system tablespace) to leaf pages of secondary

indexes, as the index pages are read to the buffer pool.

• Purge

Deleting delete-marked records that are no longer visible to active transactions.

The steps that follow redo log application do not depend on the redo log (other than for logging the writes)

and are performed in parallel with normal processing. Of these, only rollback of incomplete transactions is

special to crash recovery. The insert buffer merge and the purge are performed during normal processing.

After redo log application, InnoDB attempts to accept connections as early as possible, to reduce

downtime. As part of crash recovery, InnoDB rolls back transactions that were not committed or in XA

PREPARE state when the server crashed. The rollback is performed by a background thread, executed in

parallel with transactions from new connections. Until the rollback operation is completed, new connections

may encounter locking conflicts with recovered transactions.

In most situations, even if the MySQL server was killed unexpectedly in the middle of heavy activity,

the recovery process happens automatically and no action is required of the DBA. If a hardware

failure or severe system error corrupted InnoDB data, MySQL might refuse to start. In this case, see

更多请翻阅MySQL官网相关章节 Section 15.21.2, “Forcing InnoDB Recovery”.

crash recovery mysql_InnoDB crash recovery 完整过程相关推荐

  1. Android运行时Crash自动恢复框架-Recovery

    转自:http://zhengxiaoyong.me/2016/09/05/Android%E8%BF%90%E8%A1%8C%E6%97%B6Crash%E8%87%AA%E5%8A%A8%E6%8 ...

  2. Crash/Instance Recovery与Media Recovery的本质区别

    Crash/Instance Recovery与Media Recovery的本质区别在于: Crash/Instance Recovery针对需要恢复的实例从增量检查点(incremental ch ...

  3. 【Oracle】-Difference between Instance recovery and Crash Recovery

    Difference between Instance recovery and Crash Recovery ============================================ ...

  4. Linux的recovery分区编译,Recovery移植之高级小白教程——Recovery的编译

    目前一直在学习源码方面的知识,前段时间刚刚搞定了recovery的移植.这方面的资料真实少之又少啊,谷歌了几天,文章也就那几篇而已,更别提国内的资料了.你让我们热爱学习的小白情何以堪.于是乎就开始动手 ...

  5. Qt最新版5.14在Windows环境静态编译安装和部署的完整过程 VS 2019-Qt static link build Windows 32 bit/64 bit

    文章目录 为什么要静态编译(static link) 1.源码下载/source code download 2. 编译工具下载/compiler download 编译环境选择:MinGW/MSVC ...

  6. Qt最新版5.13在Windows环境静态编译安装和部署的完整过程(VS 2017/VS 2019)

    文章目录 为什么要静态编译 1.源码下载 2. 编译工具下载 ActivePerl Python Ruby 编译环境选择 3.编译 1.修改源码里的qtbase\mkspecs\common\msvc ...

  7. Qt最新版5.12在Windows环境静态编译安装和部署的完整过程(VS2017)

    文章目录 为什么要静态编译 1.源码下载 2. 编译工具下载 ActivePerl Python Ruby 编译环境选择 3.编译 1.修改源码里的qtbase\mkspecs\common\msvc ...

  8. 【组合数学】递推方程 ( 无重根递推方程求解实例 | 无重根下递推方程求解完整过程 )

    文章目录 一.斐波那契数列求解 二.无重根下递推方程求解完整过程 一.斐波那契数列求解 1 . 斐波那契数列示例 : ( 1 ) 斐波那契数列 : 1,1,2,3,5,8,13,⋯1 , 1 , 2 ...

  9. StartSSL免费SSL证书申请和账户注册完整过程

    HTTPS就等于HTTP加上TLS(SSL),HTTPS协议的目标主要有三个: 数据保密性.保证内容在传输过程中不会被第三方查看到.就像快递员传递包裹时都进行了封装,别人无法知道里面装了什么东西. 数 ...

最新文章

  1. Science:豆科植物如何建造“固氮工厂”?Murray组在根瘤共生机制取得重要进展...
  2. openfire 插件开发
  3. 一起智慧课堂_智慧课堂与传统课堂相比,优点在哪些
  4. 如何做好网络推广中有关网站优化中内链搭建都有什么方法?
  5. 站点某些网页想显示母版页内的用户控件,某些网页不想显示,怎样实现
  6. django后台接收form-data 格式上传的文件
  7. phpmyadmin的安装部署
  8. 季枫老师java全集_PHP冒泡排序,摘取季枫老师视频的冒泡排序内容!
  9. CREO - 基础3 - 用拉升的方法构建一个双轮胎模型
  10. CPU为什么不做成圆的而是方的?
  11. MySQL架构体系(从一条语句出发了解MySQL各部分的作用)
  12. [Canvas]空战游戏进阶 增加发射子弹 敌机中弹爆炸功能
  13. 《麦肯锡方法》第2章探索分析问题的方法-思维导图
  14. Unity-WebGL基于JS实现网页录音
  15. 工业物联网与人工智能合体之后 竟把魔爪第一个伸向了她……
  16. 基于Luckysheet实现的协同编辑在线表格支持在线导入数据库,前端导出,前端导入,后端导出
  17. CSS-盒子模型,标准盒子模型,IE 盒子模型,盒模型之间的转换
  18. Python模拟微信发红包
  19. Apache Kafka-auto.offset.reset参数(earliest、latest、none)含义说明
  20. 解决VirtualBox安装Ubuntu时界面显示不全问题

热门文章

  1. linux 误删除mysql表能恢复吗,Linux误删数据恢复
  2. php助手函数自定义,Laravel 添加自定义助手函数
  3. python 配置文件中密码不能是明文_配置文件中明文密码改为密文密码的方法
  4. 浙江金融职业学院计算机一级,浙江金融职业学院全景-360度,720度,高清全景地图-expoon网展...
  5. jsp文件能转换html吗,html怎么转换成jsp
  6. Python 列表list与数组array的区别
  7. 【渝粤题库】陕西师范大学300011 历史文献学
  8. 【渝粤题库】陕西师范大学500001 理论力学 作业(专升本)
  9. 【渝粤题库】国家开放大学2021春2019统计学原理题目
  10. 大功率无线数传设备不接天线有何影响?