1. 05 Jul, 2021 5 commits
    • Kirill Smelkov's avatar
      fixup! Fix loadBefore vs GC · 3d09f75e
      Kirill Smelkov authored
      Make sure that loadBefore actually uses ._conflict_cache data
      3d09f75e
    • Kirill Smelkov's avatar
      Fix loadBefore vs GC · 7099fd12
      Kirill Smelkov authored
      TemporaryStorage uses
      
          ._index   {} oid -> serial
          ._opickle {} oid -> data
      
      as data store for load. However for loadBefore
      
          ._conflict_cache  {} (oid,serial) -> (data, time)
      
      is reused as data store.
      
      That would be ok if that place would be treated as data store, but given
      its primary purpose - as its name suggests - was originally to be a
      cache to resolve conflicts, it is "logical" that entries in this cache
      are garbage-collected when entry age becomes > gc threshold.
      
      Only now there is a problem: if an object is committed once, and time
      passes, corresponding entry in ._conflict_cache will be removed. And this
      would manifest itself as
      
          - load(oid)  -> gives latest data for the object (obtained via ._index and ._opickle)
      
      but
      
          - loadBefore(oid, @head)  -> gives POSKeyError
      
      -> Fix it by always preserving latest object revision in
      ._conflict_cache from being removed on GC.
      
      The fix is important for systems that use ZODB5, or ZODB4-wc2[1] because
      there ZODB.Connection switched from primarily using load to exclusively
      using loadBefore.
      
      /cc @icemac @mauritsvanrees @mgedmin @d-maurer @dwt @hannosch
      
      Fixes: https://github.com/zopefoundation/tempstorage/issues/8
      [1] nexedi/ZODB@8e7eab33
      7099fd12
    • Kirill Smelkov's avatar
      Merge pull request #17 from navytux/y/ci · 7670236c
      Kirill Smelkov authored
      Fix CI
      
      - Fix tests for ZODB5.6
      - Switch from Travis to GitHub actions
      
      See individual commits for details.
      
      /reviewed-by @dataflake 
      /reviewed-on https://github.com/zopefoundation/tempstorage/pull/17
      7670236c
    • Kirill Smelkov's avatar
      ci: Switch from Travis to GitHub Actions · 032c4ed3
      Kirill Smelkov authored
      - Travis stopped providing unlimited free minutes to free software projects,
      - Most zopefoundation/* projects already switch to GitHub actions for that reason,
      - Despite tempstorage being dormant for a long time with no push/PR
        activity, Travis did not run any tests at all for https://github.com/zopefoundation/tempstorage/pull/16
      032c4ed3
    • Kirill Smelkov's avatar
      Fix tests with ZODB 5.6 · 7c0dd909
      Kirill Smelkov authored
      By definition IStorage level methods need to be passed in storage-level
      IStorageTransactionMetaData, not regular transaction.Transaction
      objects:
      
      https://github.com/zopefoundation/ZODB/blob/5.6.0-35-g1fb097b41/src/ZODB/interfaces.py#L827-L830
      
      Passing in there regular transaction.Transaction used to work
      historically, but after https://github.com/zopefoundation/ZODB/commit/2f8cc67a
      it started to fail as:
      
          Error in test test_conflict_cache_clears_over_time (tempstorage.tests.testTemporaryStorage.TemporaryStorageTests)
          Traceback (most recent call last):
            File "/usr/lib/python2.7/unittest/case.py", line 329, in run
              testMethod()
            File "/home/kirr/src/wendelin/z/tempstorage/src/tempstorage/tests/testTemporaryStorage.py", line 195, in test_conflict_cache_clears_over_time
              self._dostore(storage, oid1, data=MinPO(5))
            File "/home/kirr/src/wendelin/z/tempstorage/src/tempstorage/tests/testTemporaryStorage.py", line 132, in _dostore
              storage.tpc_begin(t)
            File "/home/kirr/src/wendelin/z/ZODB/src/ZODB/BaseStorage.py", line 193, in tpc_begin
              ext = transaction.extension_bytes
          AttributeError: 'Transaction' object has no attribute 'extension_bytes'
      
      -> Fix it by using storage-level transactions in tests.
      7c0dd909
  2. 02 Jul, 2021 1 commit
  3. 13 May, 2020 1 commit
  4. 15 Aug, 2019 4 commits
  5. 14 Aug, 2019 1 commit
  6. 13 Aug, 2019 4 commits
  7. 12 Aug, 2019 1 commit
  8. 10 May, 2019 6 commits
  9. 06 May, 2019 1 commit
  10. 09 Apr, 2019 5 commits
  11. 27 Nov, 2017 4 commits
  12. 19 Sep, 2017 1 commit
  13. 08 Sep, 2017 1 commit
  14. 09 Mar, 2017 5 commits