Bug #69097 | mysqld scans all binary logs on crash recovery | ||
---|---|---|---|
Submitted: | 29 Apr 2013 22:51 | Modified: | 26 Sep 2014 11:18 |
Reporter: | Yoshinori Matsunobu (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.6.11 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[29 Apr 2013 22:51]
Yoshinori Matsunobu
[30 Apr 2013 3:58]
MySQL Verification Team
Hello Yoshinori, Thank you for the report. Verified as described. Thanks, Umesh
[14 Aug 2014 16:32]
David Moss
The following has been added to the 5.7.5 documentation with commit 39619: simplified_binlog_gtid_recovery By default, when MySQL recovers from a crash it iterates through binary log files searching for GTID events starting from the oldest file, which can take a long time if you have a large number of binary log files. By enabling this option, the newest binary log file is instead searched for GTID events. If a Previous_gtids_log_event and Gtid_log_event are found, gtid_executed and gtid_purged are initialized using these events as usual during recovery. If no GTID events are found, a second scan then searches the oldest binary log file for GTID events. If neither of these files contain the GTID events, no more binary log files are searched, and gtid_executed and gtid_purged are set to the empty string.
[14 Aug 2014 16:33]
David Moss
Posted by developer: The following has been added to the 5.7.5 documentation with commit 39619: simplified_binlog_gtid_recovery By default, when MySQL recovers from a crash it iterates through binary log files searching for GTID events starting from the oldest file, which can take a long time if you have a large number of binary log files. By enabling this option, the newest binary log file is instead searched for GTID events. If a Previous_gtids_log_event and Gtid_log_event are found, gtid_executed and gtid_purged are initialized using these events as usual during recovery. If no GTID events are found, a second scan then searches the oldest binary log file for GTID events. If neither of these files contain the GTID events, no more binary log files are searched, and gtid_executed and gtid_purged are set to the empty string.
[25 Sep 2014 12:33]
Laurynas Biveinis
Has this been fixed in 5.6.21 but not documented as such? revno: 6110 committer: Bill Qu <bill.qu@Oracle.com> branch nick: mysql-5.6 timestamp: Fri 2014-08-08 10:12:49 +0800 message: BUG#16741603: MYSQLD SCANS ALL BINARY LOGS ON CRASH RECOVERY Mysql server iterates backwards through binary logs, looking for the last binary log that contains a Previous_gtids_log_event for gathering the set of gtid_executed, and iterates forwards through binary logs, looking for the first binary log that contains both Previous_gtids_log_event and gtid_log_event for gathering the set of gtid_purged on crash recovery. Mysql server also iterates forwards through binary logs, looking for the first binary log that contains both Previous_gtids_log_event and gtid_log_event for gathering the set of gtid_purged when purging binary logs. This may take very long time if the mysql server has many binary logs and almost all of them are out of filesystem cache. To fix the problem, introduce an option 'simplified-binlog-gtid-recovery', whose default value is false. If the option is enabled, we do this: In the first scan (where it iterates over binary logs from the newest to the oldest): If the last binary log does not contain any GTID event, do not read any more binary logs, and set GTID_EXECUTED = '' and GTID_PURGED = ''. Otherwise, initialize GTID_EXECUTED as usual. Then, in the second scan (where it iterates from the oldest to the newest): If the first binary log does not contain any GTID event, do not read any more binary logs, and set GTID_PURGED = ''.
[25 Sep 2014 12:48]
Laurynas Biveinis
Doc bug 74071 for 5.6.
[26 Sep 2014 11:18]
David Moss
In fact this was also published for 5.6.21 on the 14th August 2014 and the content is visible online here: http://dev.mysql.com/doc/refman/5.6/en/replication-options-gtids.html#sysvar_simplified_bi...
[30 Sep 2014 14:04]
David Moss
Posted by developer: Also added to the release notes, visible here: http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-21.html
[5 May 2022 9:01]
lei luo
未知错误7592
Attachment: 微信图片_20220505170006.png (image/png, text), 20.01 KiB.
[5 May 2022 9:01]
lei luo
未知错误7592
Attachment: 微信图片_20220505170006.png (image/png, text), 20.01 KiB.