• Kirill Smelkov's avatar
    pack: Clear all non-current entries after pack · 32c9a7af
    Kirill Smelkov authored
    Else those non-current entries can be used to serve a loadBefore request
    with data, while, after pack that loadBefore request must return "data
    deleted" if requested object has current revision >= packtime.
    
    Fixes checkPackVSConnectionGet from ZODB from https://github.com/zopefoundation/ZODB/pull/322
    which, without this patch fails as e.g.
    
        Failure in test checkPackVSConnectionGet (ZEO.tests.testZEO.MappingStorageTests)
        Traceback (most recent call last):
          File "/usr/lib/python2.7/unittest/case.py", line 329, in run
            testMethod()
          File "/home/kirr/src/wendelin/z/ZODB/src/ZODB/tests/PackableStorage.py", line 636, in checkPackVSConnectionGet
            raises(ReadConflictError, conn1.get, oid)
          File "/usr/lib/python2.7/unittest/case.py", line 473, in assertRaises
            callableObj(*args, **kwargs)
          File "/usr/lib/python2.7/unittest/case.py", line 116, in __exit__
            "{0} not raised".format(exc_name))
        AssertionError: ReadConflictError not raised
    32c9a7af
test_cache.py 47.8 KB