[ZODB-Dev] Old transaction records with "bad" pickle data preventing packing
shane at hathawaymix.org
Mon Jun 14 04:19:59 EDT 2010
On 06/14/2010 01:43 AM, Jens Vagelpohl wrote:
> My question: Is there any risk associated with ignoring the failure
> during packing? The latest object versions for the persistent objects in
> question do not have the problematic attribute anymore, so the latest
> records are "safe" and will not cause the AttributeError, anyway.
In the general case, a failure to unpickle could be caused by some
temporary condition, so we can't ignore it. For example, a broken
__setstate__ method could be involved. Ignoring unpickling errors could
cause the pack to not discover all references and possibly delete more
objects than it should.
In your case, you have already determined that this specific pickle is
permanently broken, so the references from it don't matter and packing
is probably safe. However, can you be certain that the rest of your
database is free of temporarily broken pickles? If I were you, I would
add some logging to ensure the exception handler is triggered only once,
pack, and then revert the ZODB code change.
More information about the ZODB-Dev