[ZODB-Dev] Re: ZODB packing error

Jeremy Hylton jeremy at alum.mit.edu
Mon Apr 5 11:19:00 EDT 2004


On Mon, 2004-04-05 at 10:39, Jeremy Hylton wrote:
> On Mon, 2004-04-05 at 10:10, Barry Warsaw wrote:
> > On Mon, 2004-04-05 at 10:07, Casey Duncan wrote:
> > 
> > > Another approach might be to increase the pack time automagically so
> > > that it falls just before the start time of all transactions that are
> > > in-progress. This would mean that "pack 0" actually might me "pack to 1
> > > minute ago" if a transaction that started a minute ago was still going
> > > when the pack was invoked.
> > 
> > Or, change the semantics of "pack 0" to mean "pack to the just before
> > the start time of the earliest current in-progress transaction".
> 
> There's no way for the storage to know what transactions are currently
> in progress, so that's not an option for the storage interface.  But
> MVCC makes it plausible that the DB could figure out the current
> transaction.  Each Connection now has a _txn_time used to determine what
> tid to use for request non-current revisions.  The lowest _txn_time of
> all Connections is a decent approximation of the lowest tid that could
> still be used in conflict resolution.  It's possible for _txn_time to be
> None, in which case you would probably use the tid of the last
> invalidation message the DB received.

Despite that it's possible to implement, I should say: who cares?  Pack
is an infrequent operation and conflict resolution is a performance
optimization.  If an infrequent pack causes an occasional performance
hack to fail, it doesn't make any significant difference.  In
particular, the conflict resolution might have failed anyway, so the
application programmer still needs to be prepared for it.

Jeremy





More information about the ZODB-Dev mailing list