Bug #13494 | Log size differences create possibility of corruption | ||
---|---|---|---|
Submitted: | 26 Sep 2005 18:35 | Modified: | 4 Oct 2012 6:17 |
Reporter: | C.J. Adams-Collier | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S4 (Feature request) |
Version: | 4.0.24_Debian-10-log | OS: | Linux (Debian GNU) |
Assigned to: | Marko Mäkelä | CPU Architecture: | Any |
[26 Sep 2005 18:35]
C.J. Adams-Collier
[26 Sep 2005 19:50]
Heikki Tuuri
Hi! In your example case, no corruption can occur. InnoDB simply refuses to start with a log file of a wrong size. Further corruption CAN occur if mysqld crashes and the user tries to resolve the problem by deleting old ib_logfiles, or replacing them with wrong ib_logfiles. But then the database is probably corrupt anyway, because otherwise the user would have been happy with the automatic crash recovery of InnoDB. The main problem that I have observed is diagnosing the crashes that result from wrong logfiles. It is often difficult to tell why mysqld segfaulted. The following feature would solve this diagnosis problem: http://www.innodb.com/todo.php " Add more safety checks that would prevent one from using wrong ib_logfiles with ibdata files. InnoDB could once per minute stamp the current lsn to the trx system page in ibdata1, and at a startup compare the stamp to the log files, as well as to the shutdown lsn stamps in the ibdata files. " Regards, Heikki
[30 Sep 2008 20:31]
C.J. Adams-Collier
Thanks Heikki, Has this feature been implemented since last we spoke? Cheers, C.J.
[11 Nov 2010 22:24]
Calvin Sun
bug#16533 is marked as a dup.
[15 Apr 2012 20:32]
Jon Brewer
This procedure also works for 5.5.15-log on Windows 7 Home Premium. Thanks for solution! Regards Jon Brewer
[4 Oct 2012 6:17]
Marko Mäkelä
This error will be fixed in MySQL 5.6.8. In the case of a size mismatch, we would apply the old logs and then rewrite new ones. Also, with this change, the log file creation and database startup should be more crash-safe. Previously, if mysqld was killed while it was creating the files, it would not recover, and you would have to delete all files before restarting. There does seem to be a possibility of corruption before the fix in MySQL 5.6.8. If you start InnoDB with a smaller innodb_log_files_in_group (the configured number of ib_logfile* files), then InnoDB may treat the log as corrupted. The ib_logfile* files are treated as if they were concatenated together. If you 'truncate' the logs by reducing the number of files that InnoDB tries to open, all bets are off.
[30 Dec 2012 7:27]
MySQL Verification Team
http://bugs.mysql.com/bug.php?id=67993 is a duplicate of this