[Checkins] [zopefoundation/ZODB] 572a96: Better support of the new API to notify of resolve...

GitHub noreply at github.com
Fri Jul 1 14:37:41 CEST 2016


  Branch: refs/heads/handle-serial-4
  Home:   https://github.com/zopefoundation/ZODB
  Commit: 572a96521e626542c0328708d714f2254254dd75
      https://github.com/zopefoundation/ZODB/commit/572a96521e626542c0328708d714f2254254dd75
  Author: Julien Muchembled <jm at nexedi.com>
  Date:   2016-07-01 (Fri, 01 Jul 2016)

  Changed paths:
    M src/ZODB/BaseStorage.py
    M src/ZODB/Connection.py
    M src/ZODB/blob.py
    M src/ZODB/tests/MVCCMappingStorage.py
    M src/ZODB/tests/blob_packing.txt
    M src/ZODB/tests/testConnection.py
    M src/ZODB/tests/testblob.py

  Log Message:
  -----------
  Better support of the new API to notify of resolved conflicts (store/tpc_finish)

When switching all storages to the new API in the master branch,
I found a few issues, mainly with blobs.

1. Created/modified blobs are invalidated during the first phase
   (in Connection._store_objects):

    obj._p_invalidate()

    And with the old API, _handle_serial then sets _p_serial
    Ghost objects are not supposed to have a _p_serial and with the new API,
    a few tests would fail because _p_serial are checked without activating the
    blob first.

2. Another consequence of _handle_serial not updating _p_changed/_p_serial
   immediately is that created objects are stored twice if __getstate__
   modifies itself. This case is tested in testConnection by
   doctest_lp485456_setattr_in_setstate_doesnt_cause_multiple_stores

    Hence the change in Connection._commit:
    - self._modified is already appended in Connection._store_objects
    - (obj._p_serial == z64) instead of (oid in self._creating)
      would not work for savepoints.

3. Setting _p_changed of a Blob with no uncommitted changes would cause an error
   (lp440234_Setting__p_changed_of_a_Blob_w_no_uncomitted_changes_is_noop)

    Fixed by the same change as in 2:
    - oid was appended twice to self._modified but reverted one
      (self._modified.pop() in _store_objects)
    - the test passed because _p_changed was reset early by _handle_serial




More information about the checkins mailing list