Mysql 5.7 Gtid内部学习(七) 总结binlog_gtid_simple_recovery参数带来的影响

发布时间:2020-08-07 08:12:10 作者:gaopengtttt
来源:ITPUB博客 阅读:146

简书地址:
http://www.jianshu.com/p/c9888d6447c8

想了想还是专门开了一节来总结这个问题
5.7.6以下中默认

5.7.6以上中默认

默认值就是最合理的设置。
因为参数名更改了所以下面统称simple_recovery来代替。

一、Gtid关闭


5.7.6以下:这种方式一定得到正确的Gtid集合

5.7.6以上:这种方式一定得到正确的Gtid集合


5.7.6以下:这种情况可能得不到正确的Gtid集合

5.7.6以上:由于有每个binlog都有Previous gtid Event的支持能够得到正确的Gtid集合。

二、Gtid打开


5.7.6以下:这种方式一定得到正确的Gtid集合。

5.7.6以上:这种方式一定得到正确的Gtid集合


5.7.6以下:这种情况可能得不到正确的Gtid集合

5.7.6以上:由于有每个binlog都有Previous gtid Event的支持能够得到正确的Gtid集合。

三、本节总结

可以看到Gtid也越来越成熟了。这部分的逻辑在函MYSQL_BIN_LOG::init_gtid_sets中前文已经提到过,这里就不看代码了。

此外在5.7的官方文档中对binlog_gtid_simple_recovery=true 有如下警告的描述:

If this option is enabled, gtid_executed and gtid_purged may be
initialized incorrectly in the following situations:
? The newest binary log was generated by MySQL 5.7.5 or older, and
gtid_mode was ON for some binary logs but OFF for the newest binary log.
? A SET GTID_PURGED statement was issued on a MySQL version
prior to 5.7.7, and the binary log that was active at the time of the SET
GTID_PURGED has not yet been purged.
If an incorrect GTID set is computed in either situation, it will remain incorrect
even if the server is later restarted, regardless of the value of this option. 

如果将参数设置为true可能在老版本中得不到正确的Gtid集合,也是前面讨论的。

学习完本节至少能够学习到:

作者微信:


Mysql 5.7 Gtid内部学习(七) 总结binlog_gtid_simple_recovery参数带来的影响
推荐阅读:
  1. MySQL中GTID追踪的自适应路由查询是怎样的
  2. 面试BAT前先搞定这18道MySQL经典面试题(含答案解析)

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

gtid very binlog

上一篇:获取文件上载对象的输入流

下一篇:Linux系统的引导过程与服务控制

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》