[ZODB-Dev] ReadConflictError while re-indexing big fat index
Tim Peters
tim at zope.com
Mon Aug 2 13:41:36 EDT 2004
[Roché Compaan]
...
> Anyway, if I'm not mistaken, a ReadConflict will occur if an object is
> invalidated after it was loaded by the client.
Almost: change "after" to "before".
you read object 1
another transaction commits a change to object 2
you get an invalidation for object 2 as a result
you try to read object 2
Now you get a read conflict: ZODB is protecting you from seeing object 2 in
a state that may be inconsistent with the state you already have for object
1. If you had read object 2 before it was invalidated, no problem, then the
states you see for objects 1 and 2 are consistent.
MVCC takes a different approach to maintaining consistency: when you try to
read object 2, under MVCC it doesn't matter that it has been invalidated.
Regardless of whether it was, you'll see the state object 2 had at the time
the transaction began, as if you had read object 2 before it was
invalidated. This is conceptually straightforward, but required substantial
redesign so that caches could keep track of multiple revisions of an object
correctly.
More information about the ZODB-Dev
mailing list