1. 05 Jul, 2021 2 commits
    • Kirill Smelkov's avatar
      fixup! Fix loadBefore vs GC · 77b49295
      Kirill Smelkov authored
      Make sure that loadBefore actually uses ._conflict_cache data
      77b49295
    • Kirill Smelkov's avatar
      Fix loadBefore vs GC · 192c535c
      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] ZODB@8e7eab33
      192c535c
  2. 02 Jul, 2021 3 commits
  3. 03 Apr, 2016 2 commits
  4. 20 Dec, 2014 2 commits
  5. 18 Dec, 2014 1 commit
  6. 06 Nov, 2014 1 commit
  7. 18 Mar, 2014 2 commits
  8. 17 Mar, 2014 5 commits
  9. 13 Mar, 2013 1 commit
  10. 12 Mar, 2013 1 commit
  11. 26 Feb, 2013 1 commit
  12. 14 Oct, 2012 4 commits
  13. 29 Sep, 2010 3 commits
  14. 25 Sep, 2010 7 commits
  15. 05 Jun, 2010 2 commits
  16. 02 May, 2010 3 commits