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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
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
Hide 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():
...
@@ -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
lib/zodb.py
View file @
5be94d4d
...
@@ -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
):
...
...
setup.py
View file @
5be94d4d
...
@@ -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
...
...
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