[ZODB-Dev] [RFC] Allow serial to be returned as late as tpc_finish.

Vincent Pelletier vincent at nexedi.com
Tue Dec 14 11:55:09 EST 2010


Some comments on previous mail.

Le mardi 14 décembre 2010 16:40:18, Vincent Pelletier a écrit :
> This makes possible for storage to allocate serial inside tpc_finish,
> removing the requirement to serialise 2PC's second phase phase (tpc_vote
> to tpc_finish/tpc_abort).

The diff chunk for Connection.py contains the real payload of this patch, the 
rest fixes all unit tests (note: tests should not fail on existing storage if 
they are left unchanged, but they fail with NEO - which now needs this patch).

Some notes, on which I would like some feedback.

Connection.py:
  I duplicate a part of _handle_serial, because:
  - some cases tested in _handle_serial don't apply to this case
  - I think calling the same method inside a loop is not so efficient
  but otherwise it's not a problem to reuse existing code.

interfaces.py:
  Is there something else I should update ? (some documentation,...)

On tests in general:
  In some cases, when tpc_finish returns non-None value, some checks gets
  disabled (ex: "eq(len(set(oids)), 2)"). I think this is legitimate, as
  tpc_finish returns only a serial so ZODB-level must keep track of which
  objects it must invalidate.

Regards,
-- 
Vincent Pelletier


More information about the ZODB-Dev mailing list