- 02 Jul, 2021 2 commits
-
-
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
-
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.
-
- 13 May, 2020 1 commit
-
-
Michael Howitz authored
-
- 15 Aug, 2019 4 commits
-
-
Michael Howitz authored
-
Michael Howitz authored
-
Michael Howitz authored
-
rekcäH nitraM authored
* Document deprecation of this package. * Document suggested alternatives. * Warn at runtime about the deprecation status of the package so developers using it can get a hint even when they don't read the readme of this package.
-
- 14 Aug, 2019 1 commit
-
-
rekcäH nitraM authored
Document deprecation of this package.
-
- 13 Aug, 2019 4 commits
-
-
Martin Häcker authored
-
Martin Häcker authored
-
Martin Häcker authored
-
rekcäH nitraM authored
Apply suggestion Co-Authored-By: Michael Howitz <mh@gocept.com>
-
- 12 Aug, 2019 1 commit
-
-
Martin Häcker authored
-
- 10 May, 2019 6 commits
-
-
Michael Howitz authored
-
Michael Howitz authored
-
Michael Howitz authored
-
Michael Howitz authored
-
Michael Howitz authored
-
Jens authored
* fix RuntimeError in py3 * move test requirements from tox.ini to setup.py
-
- 06 May, 2019 1 commit
-
-
Michael Howitz authored
[skip ci]
-
- 09 Apr, 2019 5 commits
-
-
Jürgen Gmach authored
modified: .travis.yml modified: CHANGES.rst modified: setup.py modified: tox.ini
-
Jürgen Gmach authored
modified: .travis.yml modified: CHANGES.rst modified: setup.py modified: tox.ini
-
Jürgen Gmach authored
cf https://docs.travis-ci.com/user/languages/python/#pypy-support This closes #9. modified: .travis.yml modified: CHANGES.rst
-
Jürgen Gmach authored
... by installing an updated setuptools version. modified: .travis.yml
-
Michael Howitz authored
-
- 27 Nov, 2017 4 commits
-
-
Jim Fulton authored
-
Jim Fulton authored
-
Jim Fulton authored
-
Jim Fulton authored
-
- 19 Sep, 2017 1 commit
-
-
Roel Bruggink authored
This prevents a KeyError: '\x00\x00\x00\x00\x00\x00\x00\x00'
-
- 08 Sep, 2017 1 commit
-
-
Hanno Schlichting authored
-
- 09 Mar, 2017 8 commits
-
-
Jim Fulton authored
Removed doubt-inducing version pins
-
Jim Fulton authored
-
Hanno Schlichting authored
-
Hanno Schlichting authored
-
Hanno Schlichting authored
-
Jim Fulton authored
fixed a bug in loadBefore
-
Jim Fulton authored
I guess there were no tests of GC.
-
Jim Fulton authored
That was made effective by recent changes in ZODB that relied more on loadBefore for MVCC. Oddly the change makes this loadBefore match the version it was copied from, which github says was last changed 13 years ago. (gulp, on multiple levels).
-
- 24 Feb, 2017 1 commit
-
-
Hanno Schlichting authored
-