MySQL参数解析 innodb_fast_shutdown

2023年 8月 15日 67.2k 0

innodb_fast_shutdown:

  • 作用范围:Global
  • 动态修改:Yes
  • 取值范围:0,1,2
  • 默认值:1

innodb_fast_shutdown 参数用于设置MySQL InnoDB引擎的关闭模式。

设置为0时,InnoDB关闭的最慢,需要清除所有的undo log(除了XA prepare 的事务),完成change buffer的合并,将脏页刷盘,关闭redo log。

设置为1时,不需要清除undo log,也不会合并change buffer,只将脏页刷盘,关闭redo log。

设置为2时,不清除undo log,不合并change buffer,也不将脏页刷盘,只将redo log buffer中的日志写到redo文件并刷到磁盘,保证已提交的事务不会丢失,因此等下次启动进行恢复的时候它是最耗时的。

看一下8.0.20源码中关于该参数的解释,如下:

/** The value of the configuration parameter innodb_fast_shutdown,controlling the InnoDB shutdown.

If innodb_fast_shutdown=0, InnoDB shutdown will purge all undo log records (except XA PREPARE transactions) and complete the merge of the entire change buffer, and then shut down the redo log.

If innodb_fast_shutdown=1, InnoDB shutdown will only flush the buffer pool to data files, cleanly shutting down the redo log.

If innodb_fast_shutdown=2, shutdown will effectively 'crash' InnoDB(but lose no committed transactions). */

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论