Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
5be94d4d
Commit
5be94d4d
authored
Apr 01, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
636f9cfa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
+24
-19
lib/tests/test_zodb.py
lib/tests/test_zodb.py
+18
-15
lib/zodb.py
lib/zodb.py
+0
-4
setup.py
setup.py
+6
-0
No files found.
lib/tests/test_zodb.py
View file @
5be94d4d
...
...
@@ -230,13 +230,7 @@ def test_deactivate_btree():
assert
obj
not
in
cached
# 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
()
# verify that zconn_at gives correct answer.
@
func
def
test_zconn_at
():
stor
=
testdb
.
getZODBStorage
()
...
...
@@ -256,7 +250,7 @@ def test_zconn_at():
conn2
=
db
.
open
(
transaction_manager
=
tm2
)
assert
zconn_at
(
conn2
)
==
at0
# commit
# commit
in conn1
root1
=
conn1
.
root
()
root1
[
'z'
]
=
1
tm1
.
commit
()
...
...
@@ -279,9 +273,6 @@ def test_zconn_at():
conn1
.
close
()
# 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
)
assert
conn1_
is
conn1
# from DB pool
assert
zconn_at
(
conn1
)
==
at1
...
...
@@ -305,9 +296,21 @@ def test_zconn_at():
conn2
.
close
()
# TODO commit -> know head -> open conn1,
# open conn2, commit there; wait or sync, make sure zconn_at(conn1) is as expected
# verify with historic connection @at0
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
lib/zodb.py
View file @
5be94d4d
...
...
@@ -147,12 +147,8 @@ def zconn_at(zconn): # -> tid
# ZODB5 uses MVCC uniformly
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
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
)
if
isinstance
(
zstor
,
ZODB
.
mvccadapter
.
HistoricalStorageAdapter
):
...
...
setup.py
View file @
5be94d4d
...
...
@@ -323,6 +323,12 @@ setup(
# ( NOTE: ZODB3 3.11 just pulls in latest ZODB _4_, so this way
# specifying ZODB _3_ we allow external requirements to
# 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'
,
'pygolang >= 0.0.6'
,
# defer, sync.WaitGroup, pyx/nogil channels ... XXX >= 0.0.7
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment