[ZODB-Dev] Storage API packing question

Jim Fulton jim@zope.com
Wed, 29 May 2002 09:50:49 -0400


Toby Dickenson wrote:
> 
> I have been looking into why DirectoryStorage is failing some of the ZODB
> Storage interface unit tests. It appears that some of the tests are
> implicitly relying on one characteristic which all of the current storages
> have in common. I am not sure whether this is a limitation of the tests, or a
> 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
> revisions of unreachable objects?

No.

> In most normal operation it doesnt make a difference - thats what
> *unreachable* means. It only makes a difference if something outside the ZODB
> is keeping a copy of the oid, and anything doing this is sure to break when
> used with a non-undoing storage.
> 
> Unfortunately this is exactly how some of the undo unit tests behave. The
> 'checkTransactionalUndoAfterPack' unit test dont even set up a root object,
> so *nothing* is reachable.

It would probably be better if the tests were more realistic, however,
I would prefer that, unreferenced objects stay around for some period of time
to protect against pathelogical applications that keep references to otherwise
unreferenced objects for some period of time.  In fact, I really wouldn't mind
having a way to keep unreferenced objects around for some period of time
in the Berkeley Packless storage.

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org