[Checkins] [zopefoundation/ZODB] 436d6e: Refactored FileStorage transactional undo

GitHub noreply at github.com
Tue Jul 12 22:33:45 CEST 2016


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/ZODB
  Commit: 436d6e7bb03a2db3498784b829f9695546dda80a
      https://github.com/zopefoundation/ZODB/commit/436d6e7bb03a2db3498784b829f9695546dda80a
  Author: Jim Fulton <jim at zope.com>
  Date:   2016-07-12 (Tue, 12 Jul 2016)

  Changed paths:
    M src/ZODB/FileStorage/FileStorage.py
    M src/ZODB/tests/TransactionalUndoStorage.py

  Log Message:
  -----------
  Refactored FileStorage transactional undo

As part of a project to provide object-level commit locks for ZEO, I'm
refactiring FileStorage to maintain transaction-specific data in
Tranaction.data.  This involved undo.  In trying to figure this out, I
found:

- A bug in _undoDataInfo, which I verified with some tests and

- _transactionalUndoRecord was maddeningly difficult to reason about
  (and thus change).

I was concerned less by the bug than my inability to know whether a
change to the code would be correct.

So I refactored the code, mainly transactionalUndoRecord, to make the
code easier to understand, fixing some logic errors (I'm pretty sure)
along the way.  This included lots of comments. (Comments are much
easier to compose when you're working out logic you didn't
understand.)

In addition to makeing the code cleaner, it allows undo to be handled
in cases that weren't handled before.


  Commit: 5fa51838f39651c0e22c0fbc1dbb6d89180847cd
      https://github.com/zopefoundation/ZODB/commit/5fa51838f39651c0e22c0fbc1dbb6d89180847cd
  Author: Jim Fulton <jim at zope.com>
  Date:   2016-07-12 (Tue, 12 Jul 2016)

  Changed paths:
    M src/ZODB/FileStorage/FileStorage.py

  Log Message:
  -----------
  removed out of date comment


Compare: https://github.com/zopefoundation/ZODB/compare/686f169f25f8...5fa51838f396


More information about the checkins mailing list