Personal tools
You are here: Home Storage MySQL InnoDB crash after OPTIMIZE TABLE

MySQL InnoDB crash after OPTIMIZE TABLE

Posted by Rafal Zawadzki at Mar 17, 2011 09:05 AM |

What to do with [ERROR] /usr/sbin/mysqld: Table './tablename/object_ref' is marked as crashed and last (automatic?) repair failed

MySQL InnoDB crash after OPTIMIZE TABLE

MySQL logo

One of our production database (Relstorage with MySQL backend) grow up to 450GB. What was significant - same database packed to data.fs (internal serialized Zope format) had around 350M :).

So, one afternoon I run OPTIMIZE TABLE on biggest table to perform vacuum cleaning.

Operation took around 8 hours (really) and after it, two Zope instances (from 4) were disconnected from database. Zope restart and..

MySQL throws in logs:

Mar 16 01:21:06 plone3 mysqld: 110316  1:21:06 [ERROR] /usr/sbin/mysqld: Table 
'./dbname/object_ref' is marked as crashed and last (automatic?) repair failed
Mar 16 01:21:06 plone3 mysqld: 110316  1:21:06 [ERROR] /usr/sbin/mysqld: Table
'./dbname/object_refs_added' is marked as crashed and last (automatic?) repair failed

Hm, looks awful and dangerous. How it affects site? Plone works in read mode - users are not able to create content types. Quick look on Google doesn't help. So, let's check what MySQL can offer in this situation. I run on both tables:

REPAIR TABLE object_ref;
REPAIR TABLE object_refs_added;

It took around 15 minutes (for both together) to finish operation.

Zope restart - site working flawlessly.

Comments (0)