Rudá Porto Filgueiras wrote:
> How can I repair or verify a RelStorage database?
> I´m using MySQL Adapter, there is any script like fsrecover.py
> Follow the failure when RelStorage try to load some objects:
> 2010-01-30T04:25:14 ERROR ZODB.Connection Couldn't load state for 0x04ef0f59
> Traceback (most recent call last):
> line 847, in setstate
> line 888, in _setstate
> p, serial = self._storage.load(obj._p_oid, self._version)
> line 432, in load
> raise POSKeyError(oid)
> POSKeyError: 0x04ef0f59
To diagnose this, I would:
- Examine the logs in detail. There should be a log entry giving
details about that specific POSKeyError.
- Shut down MySQL and back up the database as-is.
- Run the MySQL database verification and repair tools. It's possible
that the object you need is there, but MySQL can't find it due to
corrupted indexes or similar.
- Run a pack in dry-run mode, which will fill the object_refs table so I
can find out exactly what object(s) refer to that OID (note that
0x04ef0f59 is 82775897 in decimal).
- Use both SQL and "zopectl debug" to examine the breakage.
Running a pack in dry-run mode performs verification without actually
deleting anything. There is no fsrecover-like script, but I could be
convinced to create one if the need arises.
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org