[ZODB-Dev] Storage API packing question

Toby Dickenson tdickenson@geminidataloggers.com
Wed, 29 May 2002 14:03:06 +0100


I have been looking into why DirectoryStorage is failing some of the ZODB=
=20
Storage interface unit tests. It appears that some of the tests are=20
implicitly relying on one characteristic which all of the current storage=
s=20
have in common. I am not sure whether this is a limitation of the tests, =
or a=20
necessary requirement of the Storage interface.

On packing, the current storages which support undo will keep:
1. All revisions of all objects dated after the pack date
2. At least the current revision of all objects reachable from the root
   (even if this is before the pack date)

My question is: Is it ok for an undo-supporting storage to remove all=20
revisions of unreachable objects?=20

In most normal operation it doesnt make a difference - thats what=20
*unreachable* means. It only makes a difference if something outside the =
ZODB=20
is keeping a copy of the oid, and anything doing this is sure to break wh=
en=20
used with a non-undoing storage.

Unfortunately this is exactly how some of the undo unit tests behave. The=
=20
'checkTransactionalUndoAfterPack' unit test dont even set up a root objec=
t,=20
so *nothing* is reachable.=20

Thanks,