028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

Mysql5.7Gtid内部学习(七)总结binlog_gtid_simple_recovery参数带来的影响

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

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

雷州ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联公司的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!

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参数带来的影响

网页题目:Mysql5.7Gtid内部学习(七)总结binlog_gtid_simple_recovery参数带来的影响
本文地址:http://www.tsicrk.com/article/ppjhoe.html

其他资讯

让你的专属顾问为你服务

1.7112s