Bug #13497 Insufficiently clear error message when tablespace but not logs copied
Submitted: 26 Sep 2005 18:53 Modified: 24 Oct 2005 8:58
Reporter: James Day Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.0 OS:Any (all)
Assigned to: Osku Salerma CPU Architecture:Any

[26 Sep 2005 18:53] James Day
Description:
It's fairly common for people to copy just the InnoDB tablespace files and not the InnoDB log files. The error messages for this situation don't mention this cause:

InnoDB: is in the future! Current system log sequence number 25 1344249807.
InnoDB: Your database may be corrupt.
050922 12:29:30  InnoDB: Error: page 854290 log sequence number 26 1223718009
InnoDB: is in the future! Current system log sequence number 25 1344249807.
InnoDB: Your database may be corrupt.
050922 12:29:30  InnoDB: Error: page 854291 log sequence number 26 1224341022
InnoDB: is in the future! Current system log sequence number 25 1344249807.
InnoDB: Your database may be corrupt. Description is currently collapsed. Click to expand. 

Wrong copying seems to be more common than real corruption, so it would be good to cover this case in the error message.

How to repeat:
Copy the InnoDB tablespace to a system which already has InnoDB log files. 

Suggested fix:
Change the error message text from:

InnoDB: Your database may be corrupt

To:

InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files.

The mention of copying should give people a clue related to what they just did.
[26 Sep 2005 20:01] Heikki Tuuri
Osku,

please update the error message.

Hmm... we could also add the most common cure to the error message:

"If this warning is a result of forgetting to copy the ib_logfiles, you can remove the warnings printed by mysqld by artificially inflating the system lsn. The lsn is given as bytes. An insert raises the lsn approximately by the size of the inserted row. With a loop of repeated inserts and deletes you can raise the system lsn several gigabytes per hour."

If mysqld was shut down normally before copying the tablespace, then the lsn warnings are not that dangerous. A wrong system lsn might cause crash recovery to fail in certain situations, though.

Regards,

Heikki
[28 Sep 2005 8:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30417
[28 Sep 2005 8:18] Osku Salerma
My patch uses the wording suggested by James, and also inserts a pointer to http://dev.mysql.com/doc/mysql/en/backing-up.html. The manual seems the right place to talk about procedures for recovering from situations like this, not error messages.
[28 Sep 2005 11:42] Osku Salerma
Pushed to 5.0.14.
[24 Oct 2005 8:58] Heikki Tuuri
I think this change needs no documenting as it is self-explanatory. Closing this bug report.

--Heikki