日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

crash recovery mysql_InnoDB crash recovery 完整过程

發布時間:2023/12/2 数据库 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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”.

總結

以上是生活随笔為你收集整理的crash recovery mysql_InnoDB crash recovery 完整过程的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。