[ZODB-Dev] fsrefs.py finds POSKeyErrors, fstest.py does not

Tim Peters tim at zope.com
Thu Dec 4 16:19:28 EST 2003


[Paul Winkler]
> Is fstest.py supposed to find POSKeyErrors?
>
> I've got a Data.fs in which fsrefs.py finds numerous POSKeyErrors,
> but fscheck.py reports nothing wrong.

Sounds right to me (assuming you meant ftest.py instead of fscheck.py in the
last sentence).  The tail end of fstest's docstring says:

    Note: It does not check the consistency of the object pickles.  It is
    possible for the damage to occur only in the part of the file that
    stores object pickles.  Those errors will go undetected.

and fstest indeed doesn't unpickle anything.  Since it doesn't unpickle
anything, it has no idea about cross-object references (those are all hiding
in pickles).  What fstest does check is sanity and consistency of the file
layout (does the file begin with the right magic number for an .fs file?  do
transaction headers look sane?  do the data records inside a transaction
record add up to more bytes than the transaction record said they add up to?
was part of the last transaction record in the file lost?  very low-level
stuff like that).

fsrefs.py implicitly assumes that the file is formatted correctly (it does
none of the low-level checks done by fstest), and loads every object in the
database, from the pickles stored in the file.  POSKeyErrors come from that.




More information about the ZODB-Dev mailing list