Re: non-undoable storage using directorystorage?

"Tim Hicks" <[email protected]>
Newsgroups gmane.comp.web.zope.zodb.dirstorage
Message-ID <[email protected]>
Toby Dickenson said:

>> Ok, so would that involve writing an adjusted version of
>> _mark_reachable_objects or perhaps _mark_reachable_objects_impl?  I had
>> a
>> look at those methods and... eek!  It all looks rather complicated and I
>> couldn't even figure out where the looping over the old revisions
>> actually
>> happens.  Got any pointers?
>
> The file whose name is calculated as ('o'+stroid+'.c') contains the
> current
> serial number of the given oid. serial numbers are also known as
> "transaction
> id" or "tid".

Ok...

> (Some parts of zodb maintain a subtle distinction between "object serial
> number" and "transaction id". afaik every storage defines them to be the
> same
> thing, so in practice we can forget that a distinction ever existed.)
>
>
> The files whose names are calculated as ('o'+stroid+'.'+strtid) contain
> the
> data for one revision of that oid. That includes the pickle, which is used
> to
> determine the oids referenced by this object. These end up in the variable
> "allrefoids" - you need to keep this mechanism.

... yup, with you so far ...

> That file also includes the tid of the preceeding revision. The "while 1:"
> loop scans back through history. The "keepclass.expired" method is used to
> determine whether a given tid is sufficiently old that it does not need
> keeping.

But presumably under Minimal.py, there will be *no* preceeding revisions
for each tid as each one is explicitly overwritten by the last.  Right?


In thinking about all this, I realised that I still haven't quite groked
what needs to be changed to make Full._pack work as Minimal._pack.  All we
are trying to achieve is getting rid of 'deleted' objects from the
database.  I mean:

1) Full._pack will currently remove any file (containing a pickle) that is
not referenced by any other object and is therefore unreachable from the
root object.  These are the 'deleted' objects right?  This seems to be
what we want for Minimal._pack.

2) Full._pack will search back for previous revisions, but would
presumably not find any for a Minimal storage, so that would be harmless.

So why can't I just do the following in the Minimal.Minimal class
declaration and be done with?::

  _pack = Full._pack


Sorry, I think I'm being a bit slow.


tim


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.