crash recovery mysql_InnoDB crash recovery 完整过程

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”.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/350061.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java –远景JDK 8

世界正在缓慢但肯定地发生变化。 在进行了更改之后,使Java有了JDK 7的全新外观,Java社区期待JDK 8以及JDK 9附带的其余改进。 JDK 8的目标目的是填补JDK 7实施中的空白-该实施中剩下的部分难题,应该在2013年底之前为广大读者所用&#xff0c…

python三大结构、顺序结构_Python学习笔记3——三大结构:顺序,分支,循环3

顺序自上而下,依次执行分支分支的基本语法if 条件表达式:语句1语句2语句3......条件表达式就是计算结果必须为布尔值的表达式表达式后面的冒号不能少注意if后面的出现的语句,如果属于if语句块,则必须同一个锁紧等级条件表达式结果…

网络布线和数据转换

T568A 白绿 绿 白橙 蓝 白蓝 橙 白棕 棕 T568B 白橙 橙 白绿 蓝 白蓝 绿 白棕 棕 同种设备用交叉线 不同设备用直通线相连 PC与路由器为同种设备 交换机自成一派 转载于:https://www.cnblogs.com/qingqing1/p/11166632.html

Java 9模块系统(拼图)@ LJC的HackTheTower

今天,我们花了半天时间参加了第一次HackTheTower活动。 伦敦的Java用户组(aka LJC )的成员应伦敦市的邀请,聚集在伦敦市SalesForceTower(aka Heron Tower )26楼。 Heather VanCura是Java社区流程的主席 马…

在命令行下对ntfs分区文件夹权限的设置

随着Windows XP/Server 2003的流行,越来越多的用户开始选择NTFS文件系统,NTFS的好处自然是大大增强了系统的安全性,在“安全”标签页下, 我们可以在这里为不同级别的用户设置相应的访问控制权限,包括完全控制、修改、读…

uglifyjs报错 webpack_webpack3里使用uglifyjs压缩js时打包报错的解决

环境&#xff1a;webpac<4的下&#xff0c;安装uglifyjs。cnpm install uglifyjs-webpack-plugin -D安装完毕后&#xff0c;去npm里查看uglifyjs的使用方法并添加到代码中&#xff1a;const UglifyJsPlugin require(uglifyjs-webpack-plugin)module.exports {//...optimiz…

描述一下JVM加载class文件的原理机制

Java中的所有类&#xff0c;都需要由类加载器装载到JVM中才能运行。类加载器本身也是一个类&#xff0c;而它的工作就是把class文件从硬盘读取到内存中。在写程序的时候&#xff0c;我们几乎不需要关心类的加载&#xff0c;因为这些都是隐式装载的&#xff0c;除非我们有特殊的…

xtend怎么使用_使用Xtend构建Vaadin UI

xtend怎么使用今天&#xff0c;我决定向Xtend打个招呼。 我希望学习一些新的编程语言。 选择一个标准的清单并不多。 它必须是在JVM上运行的编程语言&#xff0c; 如果我不需要学习用于建筑应用的全新生态系统&#xff0c;那就太好了。 我检查了几个选项。 JVM的编程语言列表…

linux mysql 写shell_Linux—编写shell脚本操作数据库执行sql

修改数据库数据在升级应用时&#xff0c;我们常常会遇到升级数据库的问题&#xff0c;这就涉及到sql脚本的编写。一般我们会通过写sql脚本&#xff0c;然后将xxx.sql脚本放到数据库中进行source xxx.sql执行。本篇文章&#xff0c;我们可以通过写shell脚本来执行数据库操作。配…

DMN 1.1 XML:使用Drools 7.0从建模到自动化

我是一名自由顾问&#xff0c;但今天我是一名博士生。 本文的全球背景是企业架构&#xff08;EA&#xff09;&#xff0c;它需要对企业进行建模。 由于EA的一个方面是业务流程建模&#xff0c;所以我使用BPMN已有数年之久&#xff0c;但是这种表示方式并不十分适合表示决策标准…

mysql安装模块解释_MySQL的模块不能安装的解决方法_MySQL

我们最常用的 DBD::mysql 模块,我发现是难住很多人的地方.因为安装老是失败,下面我介绍一下解决方法,比如我使用 cpanm 安装,有时就出 /home/nue2501j/work/DBD-mysql-4.010/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: DBIc_TRACE_LEVEL at /usr/lib/perl5/5.8.5/i…

nginx访问目录是没加/的重定向控制

static 模块提供了root与alias功能&#xff1b;发现目标是目录时&#xff1b;但URI末尾未加/时&#xff1b;会返回301重定向&#xff1b;重定向后会加/ 指令 Syntax: server_name_in_redirect on | off;# 控制返回那个域名 Default: server_name_in_redirect off; Context: ht…

oracle mysql 字段_Oracle和MySQL修改字段

一、修改字段名&#xff1a;Oracle&#xff1a;ALTER TABLE tableName RENAME COLUMN oldColumnName TO newColumnName;eg: ALTER TABLE web RENAME COLUMN wen_name TO web_name;MySQL&#xff1a;ALTER TABLE tableName CHANGE oldColumnName newColumnName newColumnDataTyp…

Kafka REST Proxy for MapR Streams入门

介绍 MapR生态系统软件包2.0&#xff08;MEP&#xff09;随附了一些与MapR流有关的新功能&#xff1a; MapR Streams的Kafka REST代理为MapR Streams和Kafka集群提供RESTful接口&#xff0c;以使用和生成消息并执行管理操作。 Kafka Connect for MapR Streams是一个实用程序&…

开张大吉

在Windows的天地中做了五年开发之后&#xff0c;又跑到了开源的Linux/Java世界遨游了五年&#xff0c;于最近半年&#xff0c;又重新回到M$阵营。这半年来&#xff0c;迫于项目进度的压力&#xff0c;较少与他人交流&#xff0c;项目中虽然采用了VS2003&#xff0c;但是运用的思…

mysql四种输入_mysql四种事务隔离级别

mysql事务并发问题ACID什么的就不啰嗦了。mysql多个事务并发的时候&#xff0c;可能会出现如下问题&#xff1a;1. 更新丢失即两个事务同时更新某一条数据&#xff0c;后执行的更新操作会覆盖先执行的更新操作&#xff0c;导致先执行的更新结果丢失。2. 脏读即一个事务会读到另…

apache hadoop_春天遇见Apache Hadoop

apache hadoopSpringSource 刚刚宣布了适用于Apache Hadoop的Spring的第一个GA版本 。 该项目的目的是简化基于Hadoop的应用程序的开发。 您可以下载该项目在这里 &#xff0c;并检查了Maven的文物在这里 。 Apache Hadoop的Spring诞生是为了解决Hadoop应用程序构建不良的问题…

sinacloud webpy mysql_Mysqldb和webpy的安装

1.首先安装mysqlsudo apt-get install mysql-server2.然后安装libmysqld-dev和libmysqlclient-dev&#xff0c;否则在安装Mysqldb的时候会报找不到mysql_config文件sudo apt-get install libmysqld-devsudo apt-get install libmysqlclient-dev修改site.cfg中的mysql_config的配…

消费者驱动的Pact和Spring Boot测试

最近&#xff0c;我的一位同事偶然发现了Pact.io &#xff0c;我们的当前应用程序已发展到50多种服务&#xff0c;并且我们开始出现一些集成测试失败和脆弱的开发/验收测试环境。 因此&#xff0c;我们决定研究尝试与此相关的方法。 我从阅读开始&#xff1a; https : //docs.…

python空格怎么加密_使用Python的RSA加密

如果您想使用python高效地编码RSA加密&#xff0c;我的github存储库肯定会理解和解释python中RSA的数学定义RSA密钥生成def keyGen(): Generate Keypair i_prandint(0,20)i_qrandint(0,20)# Instead of Asking the user for the prime Number which in case is not feasible,# …