Commit 5be94d4d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 636f9cfa
...@@ -230,13 +230,7 @@ def test_deactivate_btree(): ...@@ -230,13 +230,7 @@ def test_deactivate_btree():
assert obj not in cached assert obj not in cached
# zsync syncs ZODB storage. # verify that zconn_at gives correct answer.
# it is noop, if zstor does not support syncing (i.e. FileStorage has no .sync())
def zsync(zstor):
sync = getattr(zstor, 'sync', None)
if sync is not None:
sync()
@func @func
def test_zconn_at(): def test_zconn_at():
stor = testdb.getZODBStorage() stor = testdb.getZODBStorage()
...@@ -256,7 +250,7 @@ def test_zconn_at(): ...@@ -256,7 +250,7 @@ def test_zconn_at():
conn2 = db.open(transaction_manager=tm2) conn2 = db.open(transaction_manager=tm2)
assert zconn_at(conn2) == at0 assert zconn_at(conn2) == at0
# commit # commit in conn1
root1 = conn1.root() root1 = conn1.root()
root1['z'] = 1 root1['z'] = 1
tm1.commit() tm1.commit()
...@@ -279,9 +273,6 @@ def test_zconn_at(): ...@@ -279,9 +273,6 @@ def test_zconn_at():
conn1.close() conn1.close()
# commit empty transaction - view stays in sync with storage head # commit empty transaction - view stays in sync with storage head
#
# TODO zconn_at after empty commit (with fs1 currently gives future tid,
# but db is not updated and wcfs client resync to that future tid hangs)
conn1_ = db.open(transaction_manager=tm1) conn1_ = db.open(transaction_manager=tm1)
assert conn1_ is conn1 # from DB pool assert conn1_ is conn1 # from DB pool
assert zconn_at(conn1) == at1 assert zconn_at(conn1) == at1
...@@ -305,9 +296,21 @@ def test_zconn_at(): ...@@ -305,9 +296,21 @@ def test_zconn_at():
conn2.close() conn2.close()
# TODO commit -> know head -> open conn1, # verify with historic connection @at0
# open conn2, commit there; wait or sync, make sure zconn_at(conn1) is as expected tm_old = TransactionManager()
defer(tm_old.abort)
conn_at0 = db.open(transaction_manager=tm_old, at=at0)
assert conn_at0 is not conn1
assert conn_at0 is not conn2
assert zconn_at(conn_at0) == at0
# TODO zconn_at for historic connection # ---- misc ----
# zsync syncs ZODB storage.
# it is noop, if zstor does not support syncing (i.e. FileStorage has no .sync())
def zsync(zstor):
sync = getattr(zstor, 'sync', None)
if sync is not None:
sync()
pass
...@@ -147,12 +147,8 @@ def zconn_at(zconn): # -> tid ...@@ -147,12 +147,8 @@ def zconn_at(zconn): # -> tid
# ZODB5 uses MVCC uniformly # ZODB5 uses MVCC uniformly
if zmajor >= 5: if zmajor >= 5:
# XXX gives future tid with fs1 and empty commit which leads to wcfs client resync hang
# -> fixed with https://github.com/zopefoundation/ZODB/pull/298
zstor = zconn._storage zstor = zconn._storage
if isinstance(zstor, ZODB.mvccadapter.MVCCAdapterInstance): if isinstance(zstor, ZODB.mvccadapter.MVCCAdapterInstance):
# XXX there is race in ZODB itself that leads to data corruption:
# https://github.com/zopefoundation/ZODB/issues/290
return before2at(zstor._start) return before2at(zstor._start)
if isinstance(zstor, ZODB.mvccadapter.HistoricalStorageAdapter): if isinstance(zstor, ZODB.mvccadapter.HistoricalStorageAdapter):
......
...@@ -323,6 +323,12 @@ setup( ...@@ -323,6 +323,12 @@ setup(
# ( NOTE: ZODB3 3.11 just pulls in latest ZODB _4_, so this way # ( NOTE: ZODB3 3.11 just pulls in latest ZODB _4_, so this way
# specifying ZODB _3_ we allow external requirements to # specifying ZODB _3_ we allow external requirements to
# specify either to use e.g. ZODB3.10 or ZODB4 ) # specify either to use e.g. ZODB3.10 or ZODB4 )
#
# TODO if ZODB5: require ZODB >= 5.5.2 ?
# https://github.com/zopefoundation/ZODB/pull/298
# https://github.com/zopefoundation/ZODB/pull/291
#
# ----//---- for ZODB4 >= 4.4.6
'ZODB3 >= 3.10', 'ZODB3 >= 3.10',
'pygolang >= 0.0.6', # defer, sync.WaitGroup, pyx/nogil channels ... XXX >= 0.0.7 'pygolang >= 0.0.6', # defer, sync.WaitGroup, pyx/nogil channels ... XXX >= 0.0.7
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment