Bug #68932 | A regression in 5.6 crash recovery atomicity | ||
---|---|---|---|
Submitted: | 11 Apr 2013 11:19 | Modified: | 6 Jun 2013 15:52 |
Reporter: | Laurynas Biveinis (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Logging | Severity: | S1 (Critical) |
Version: | 5.6.10, 5.6.12 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression |
[11 Apr 2013 11:19]
Laurynas Biveinis
[11 Apr 2013 11:25]
Laurynas Biveinis
The same outcome happens if the second crash injection site is replaced with crash_before_writing_xid or crash_commit_after_log .
[11 Apr 2013 11:26]
Laurynas Biveinis
Removing RESET MASTER or replacing INSERT SELECT with regular INSERTs for the same data make the problem disappear.
[15 Apr 2013 18:39]
Sveta Smirnova
Thank you for the report. Verified as described. Option --mem makes failure more repeatable, but is not necessary to repeat the bug. Running ./mtr with option --repeat=100 can lead to similar failure as well.
[28 May 2013 11:05]
Jon Stephens
Fixed in 5.6+. Documented in the 5.6.12 and 5.7.2 changelogs as follows: A crash-on-commit error followed by RESET MASTER caused InnoDB to lose the previous transaction. This occurred because the prepare phase caused a flush to disk, while the commit phase did not perform a corresponding flush within InnoDB. To fix this problem, RESET MASTER now causes storage engine logs to be flushed on commit. Closed.
[6 Jun 2013 15:52]
Laurynas Biveinis
For some mysterious reason the public bug # is not in the commit message. 5.6$ bzr log -r 5049 ------------------------------------------------------------ revno: 5049 committer: Bill Qu <bill.qu@Oracle.com> branch nick: mysql-5.6 timestamp: Sun 2013-04-28 09:21:43 +0800 message: Bug #16666456 A REGRESSION IN 5.6 CRASH RECOVERY ATOMICITY A crash commit error causes the last transaction to loss in an InnoDB table after RESET MASTER. The root cause is that the prepare phase causes fsync while the commit phase does not cause fsync inside InnoDB. That means the last transaction is not fsynced inside InnoDB. But RESET MASTER erases binlog events of the last transaction. In the following crash commit error, InnoDB has the last prepared row on recovery and calls server on how to deal with the prepared row and server does not find relevant binlog events from binary log file and rolls it back finally. To fix the problem, RESET MASTER should cause to flush logs for storage engines, so that the last transaction is fsynced inside storage engines. The same solution to internal EXPIRE_LOGS_DAYS. There is not the problem with PURGE BINARY LOGS TO, as the binlog events of last transaction in current binlog file is not purged.