Bug #11418 InnoDB: Your database may be corrupt
Submitted: 17 Jun 2005 17:33 Modified: 21 Jun 2005 9:06
Reporter: Keith Larson Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:4.0.23-standard-log OS:Feddora C2
Assigned to: Heikki Tuuri CPU Architecture:Any

[17 Jun 2005 17:33] Keith Larson
Description:
Hello,

We have a master and slave servers (of course) 

The slave is now 12 hrs behind. It appears that is dumps data to the error log for every query. 

 tail d1.###.err
InnoDB: Your database may be corrupt.
050617 13:26:51  InnoDB: Error: page 812087 log sequence number 807 2555557271
InnoDB: is in the future! Current system log sequence number 743 3697943722.
InnoDB: Your database may be corrupt.
050617 13:26:51  InnoDB: Error: page 908966 log sequence number 754 1335183696
InnoDB: is in the future! Current system log sequence number 743 3697943886.
InnoDB: Your database may be corrupt.
050617 13:26:51  InnoDB: Error: page 812090 log sequence number 807 2549442433
InnoDB: is in the future! Current system log sequence number 743 3697946353.
InnoDB: Your database may be corrupt.

The dates are on both boxes are in sync. 

How to repeat:
i tail the error log to view error.
[17 Jun 2005 18:38] Keith Larson
Ver 8.40 Distrib 4.0.23, for pc-linux on i686
[18 Jun 2005 12:36] Keith Larson
So I just did a new hotback to rebuild the slave. 

 mysqld started
050618  8:28:17 Warning: Asked for 196608 thread stack, but got 126976
050618  8:28:18  InnoDB: Log file /var/lib/mysql/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /var/lib/mysql/ib_logfile0 size to 400 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400
050618  8:28:47  InnoDB: Log file /var/lib/mysql/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /var/lib/mysql/ib_logfile1 size to 400 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400
050618  8:29:17  InnoDB: Database was not shut down normally.
InnoDB: Starting recovery from log files...
InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 860 4266163724
InnoDB: Doing recovery: scanned up to log sequence number 860 4266163724
050618  8:29:17  InnoDB: Error: page 7 log sequence number 888 2266993891
InnoDB: is in the future! Current system log sequence number 860 4266163724.
InnoDB: Your database may be corrupt.
050618  8:29:17  InnoDB: Error: page 1 log sequence number 888 2267241411
InnoDB: is in the future! Current system log sequence number 860 4266163724.
InnoDB: Your database may be corrupt.
050618  8:29:17  InnoDB: Error: page 3 log sequence number 888 553488478
InnoDB: is in the future! Current system log sequence number 860 4266163724.
InnoDB: Your database may be corrupt.
050618  8:29:17  InnoDB: Error: page 2 log sequence number 888 2267047140
InnoDB: is in the future! Current system log sequence number 860 4266163724.
InnoDB: Your database may be corrupt.
050618  8:29:17  InnoDB: Error: page 4 log sequence number 888 2267439162
InnoDB: is in the future! Current system log sequence number 860 4266163724.
InnoDB: Your database may be corrupt.
050618  8:29:17  InnoDB: Error: page 11 log sequence number 888 2267046880

050618  8:29:18 Slave SQL thread initialized, starting replication in log 'd2-bin.037' at position 147550717, relay log './d1-relay-bin.004' position: 325215198
/usr/sbin/mysqld: ready for connections.
Version: '4.0.23-standard-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Official MySQL RPM
050618  8:29:18 Slave I/O thread: connected to master 'root@d2:3306',  replication started in log 'd2-bin.037' at position 756346792
050618  8:29:18  InnoDB: Error: page 836335 log sequence number 888 2266464739
InnoDB: is in the future! Current system log sequence number 860 4266164236.
InnoDB: Your database may be corrupt.
050618  8:29:18  InnoDB: Error: page 835585 log sequence number 888 2267406894

 Slave_IO_Running: Yes
 Slave_SQL_Running: Yes

What is going on?
[19 Jun 2005 21:44] Heikki Tuuri
Keith,

remember that

ibbackup --apply-log

creates the ib_logfiles that you should use. Now you let mysqld create them, which causes the lsn to be lagging behind.

Regards,

Heikki
[21 Jun 2005 9:06] Marko Mäkelä
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Additional info:

The error is that the ibdata and ib_logfiles are not in sync with each other (on the same server). Have you perhaps moved the files around, or tried to make a backup copy while the server was running? The error shouldn't have anything to do with replication.

This is not a forum for asking support questions. Please dig logs further to find the cause of this error. We need a repeatable test case.