Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My MySQL server run to crash due to (page file write error). I did a disk diagnosis but no errors found. I restarted MySQL server. It scanned the bin log like for 1-2 hours and recorded log as below:

InnoDB: Doing recovery: scanned up to log sequence number 51 2341175808
InnoDB: Doing recovery: scanned up to log sequence number 51 2346418688
InnoDB: Doing recovery: scanned up to log sequence number 51 2351661568
InnoDB: Doing recovery: scanned up to log sequence number 51 2356904448
InnoDB: Doing recovery: scanned up to log sequence number 51 2362147328

After that, I see a lot of errors as below:

InnoDB: Number of pending reads 128, pending pread calls 0
InnoDB: Error: InnoDB has waited for 50 seconds for pending
InnoDB: reads to the buffer pool to be finished.
InnoDB: Number of pending reads 128, pending pread calls 0
InnoDB: Error: InnoDB has waited for 50 seconds for pending
InnoDB: reads to the buffer pool to be finished.
InnoDB: Number of pending reads 128, pending pread calls 0
InnoDB: Error: InnoDB has waited for 50 seconds for pending
InnoDB: reads to the buffer pool to be finished.

I have wait a few hours but it just adds those lines to error log repeatly with no sign to stop.

What does above log messages mean? How can I make my MySQL server running again? I have a 80GB InnoDB database running on this server. Is there a way to force recover it without undo any uncommited transactions or try to recover the data from page file which caused the crash? I have no problem drop those data.

I tried "sudo -u mysql /usr/sbin/mysqld –innodb_force_recovery=6" to restart MySQL server but got new repeated errors as below:

InnoDB: stored checksum 2440779633, prior-to-4.0.14-form stored checksum 3425185587
InnoDB: Page lsn 51 2450779673, low 4 bytes of lsn at page end 2450779673
InnoDB: Page number (if stored to page already) 10824,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be an index page where index id is 4294967295 0
InnoDB: (index "CLUST_IND" of table "SYS_IBUF_TABLE_0")
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 10824.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
InnoDB: about forcing recovery.
InnoDB: Ending processing because of a corrupt database page.

What should I do now?

share|improve this question
    
It would be helpful if you posted the crash itself. Usually it contains information about what page was a problem. –  Aaron Brown Oct 23 '11 at 1:16

2 Answers 2

Without the error that caused the crash, version of MySQL, and your my.cnf, it is difficult to determine what exactly the problem is....That being said, here is some generic advice....

You can find the table that has the corrupt page in a number of ways. The easiest way to shut down the server, and run innochecksum against all of the tables in your database. If it finds any problems, you can start the database in recovery mode by setting innodb_force_recovery and attempt to run a SELECT INTO OUTFILE of the table to dump the contents, then LOAD DATA FROM INFILE to load it into a new table. Start innodb_force_recovery at 1 and if you get a crash while dumping the table(s), continue to increment the innodb_force_recovery value until you can dump the data without it crashing. Make sure no clients are connecting while you do this.

Percona also has the Percona Data Recovery Tool for InnoDB that might minimize downtime, but they require some expertise to use and has potential to mess things up even more. Also, in reality, you can run innochecksum on a live database, but you will be likely to get false positives for corrupt pages. In this case, you can then down the server and only innochecksum the tables that returned page errors while it was live. On a live server, a successful innochecksum will mean that the table is fine, while a failed innochecksum might not be accurate.

When you get this situated, I would recommend creating a slave of this database so that if this happens again, you can easily just begin using the slave and not worry about complex recovery procedures.

share|improve this answer
    
thanks for your answer. I tried "sudo -u mysql /usr/sbin/mysqld –innodb_force_recovery=6" but it recorded new errors. Please see my updates of the question. –  jack Oct 23 '11 at 4:30
    
Did MySQL stay up after recovery? Did you try what I mentioned? Specifically, did you try dumping & loading theSYS_IBUF_TABLE_0? Did you try lower recovery levels first as I mentioned? –  Aaron Brown Oct 23 '11 at 11:10

I was getting a similar error, and after reading http://dba.stackexchange.com/questions/24477/innodb-corruption I decided to test my RAM. And it was defective...

I discovered that running memtester, without need to restart the machine, and got a lot of:

FAILURE: 0x657423ee6593084d != 0x84e423ee6593084d at offset 0x16f17b1a0.
FAILURE: 0x58c620a5a8e4984f != 0x783620a5a8e4984f at offset 0x16f3571a0.
FAILURE: 0x73eba2598aaaa228 != 0x935ba2598aaaa228 at offset 0x16f3db1a0.

So, if you have this error on a stable version of mysql and reboot fixes your problem, it's very likely a RAM problem. If you pay attention to the error message, it says that:

InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.

But maybe you, like me, refuse to believe it could be a hardware problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.