Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql 5.7Gtid Internal Learning (7) summarize the impact of binlog_gtid_simple_recovery parameters

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Address of the brief book:

Http://www.jianshu.com/p/c9888d6447c8

After thinking about it, I opened a special section to sum up the problem.

5.7.6 default below

Simplified_binlog_gtid_recovery=flase

Default above 5.7.6

Binlog_gtid_simple_recovery=true

The default value is the most reasonable setting.

Because the parameter name has changed, it is collectively referred to as simple_recovery instead.

1. Gtid closes simple_recovery=flase

5.7.6 below: make sure you get the correct Gtid collection in this way

Restarting Mysql requires scanning all binlog to get the correct Gtid collection purge binlog or setting the parameter expire_logs_days beyond the parameter does not trigger full binlog scanning, which is controlled by the upper function. Because online Gtid changes are not supported.

5.7.6 or above: you must get the correct Gtid collection in this way.

Restart Mysql to scan all binlog. Purge binlog or exceed the parameter expire_logs_days parameter setting to trigger a full binlog scan. Simple_recovery=true

5.7.6 below: you may not get the correct Gtid collection in this case

Restarting Mysql does not scan all binlog, only the first and last binlog. The purge binlog or expire_logs_days parameter setting does not trigger the full binlog scan and is controlled by the upper function.

5.7.6 or above: because every binlog has Previous gtid Event support, you can get the correct Gtid collection.

Restarting Mysql does not scan all binlog, only the first and last binlog. The purge binlog or expire_logs_days parameter setting does not trigger full binlog scanning, only the first and last binlog are scanned. 2. Gtid opens simple_recovery=flase

5.7.6 below: this way you must get the correct Gtid collection.

Restarting Mysql does not scan all binlog. If you open GTID halfway, you still need to scan multiple binlog because you need to find Previous gtid Event. The purge binlog or expire_logs_days parameter setting does not trigger a full binlog scan. If the GTID is turned on and restarted halfway, you still need to scan multiple binlog because you need to find the Previous gtid Event.

5.7.6 or above: you must get the correct Gtid collection in this way.

Restarting Mysql does not scan all binlog. If you turn on GTID halfway and restart, you still need to scan multiple binlog because you need to find Gtid event. The purge binlog or expire_logs_days parameter setting does not trigger a full binlog scan. If you turn on GTID halfway and restart, you still need to scan multiple binlog because you need to find the Gtid event. Simple_recovery=true

5.7.6 below: you may not get the correct Gtid collection in this case

Restarting Mysql does not scan all binlog, only the first and last binlog. The purge binlog or expire_logs_days parameter setting does not scan all binlog, only the first and last binlog are scanned.

5.7.6 or above: because every binlog has Previous gtid Event support, you can get the correct Gtid collection.

Restarting Mysql does not scan all binlog, only the first and last binlog. The purge binlog or expire_logs_days parameter setting does not trigger full binlog scanning, only the first and last binlog are scanned. Third, this section summarizes that the default setting of simplified_binlog_gtid_recovery=flase is maintained below 5.7.6, but this will lead to too many binlog scans, and 5.6 there is no support for mysql.gtid_executed, and log_slave_updates must be enabled for the slave library, which will have a performance impact. So use less Gtid. 5.7.6 since there is Previous gtid Event support for every binlog binlog_gtid_simple_recovery=true is a reasonable setting, binlog scanning is very fast because it is only the first and last binlog file.

You can see that Gtid is getting more and more mature. The logic of this part has been mentioned earlier in the letter MYSQL_BIN_LOG::init_gtid_sets, so I won't look at the code here.

In addition, the following warnings are described for binlog_gtid_simple_recovery=true in the official documentation of 5.7:

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

If you set the parameter to true, you may not get the correct Gtid collection in the previous version, as discussed earlier.

At the end of this section, you can at least learn:

How does binlog_gtid_simple_recovery/simplified_binlog_gtid_recovery affect the scanning of binlog files? how to set below 5.7.6 and above 5.7.6

Author Wechat:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report