Re: Power failure and innodb
Hi Smita,
(You were the one who contacted me by email, causing me to do some research and file Bug#75697.)
Like with any form of corruption, you should start from the scratch and restore the system from backups. If you do not have recent backups, you could basically run mysqldump, but use the READ UNCOMMITTED isolation level, and cross your fingers that the contents of the database is consistent enough.
If you are willing to take the risk, you can cut some corners by patching the transaction ID field in the TRX_SYS page to a large enough value, so that no row in any index page can be in the future. A programmer should be able to figure out the details from my bug report.
Unfortunately, I do not know the root cause of this corruption (of the maximum transaction ID).
InnoDB should 'just work' and be fully crash-safe, even against power failures. (It is unsafe to disable the doublewrite buffer unless atomic writes are supported). There have been reports of trouble after a power failure, but it turned out that the fsync() system call was misbehaving.
Given that this issue seems to be rare (I only know about these two occurrences), I would suspect a hardware fault, such as a bit flipping spontaneously in the main memory. It would be good to run Memtest86 or Memtest86+ on the server. Corruption of the disk files should be usually caught by the page
checksums computed by InnoDB.