mysql fast shutdown_MySQL参数解析 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). */

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值