Bug #65469 Infinite loop when opening a corrupted table
Submitted: 30 May 2012 21:59 Modified: 29 Jan 2013 19:25
Reporter: Davi Arnaut (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.5.23 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[30 May 2012 21:59] Davi Arnaut
Description:
If the value of innodb_force_recovery is less than 6, opening a corrupted table might loop forever if a corrupted page is read when calculating statistics for the table.

How to repeat:
See attached test case.
[30 May 2012 23:09] Davi Arnaut
Patch for Bug#65469

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: Bug-65469-Infinite-loop-when-opening-a-corrupted-tab.patch (application/octet-stream, text), 7.25 KiB.

[2 Jun 2012 16:15] Davi Arnaut
It is worth noting that this behavior occurs whenever a page is read synchronously, which is not exclusive to the described scenario.
[11 Jun 2012 23:10] Davi Arnaut
Each time InnoDB loops trying to read the corrupted page, it will also dump the contents of the page to the error log. See Bug#65579 for a manifestation.
[20 Jul 2012 0:14] Davi Arnaut
Had another occurrence of this problem. InnoDB kept printing the corrupted page to the error log until the disk eventually filled up.
[29 Jan 2013 19:25] John Russell
Added to changelog for 5.5.30, 5.6.10: 

If the value of innodb_force_recovery was less than 6, opening a
corrupted table might loop forever if a corrupted page was read when
calculating statistics for the table. Information about the corrupted
page was written repeatedly to the error log, possibly causing a disk
space issue. The fix causes the server to halt after a fixed number
of failed attempts to read the page. To troubleshoot such a
corruption issue, set innodb_force_recovery=6 and restart.