Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Kirill Smelkov
ZEO
Commits
03498c05
Commit
03498c05
authored
Jul 28, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Numerous fixes in response to:
https://github.com/zopefoundation/ZODB/pull/93
parent
7af91457
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
28 deletions
+13
-28
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+1
-3
src/ZEO/StorageServer.py
src/ZEO/StorageServer.py
+0
-1
src/ZEO/TransactionBuffer.py
src/ZEO/TransactionBuffer.py
+2
-7
src/ZEO/asyncio/client.py
src/ZEO/asyncio/client.py
+0
-1
src/ZEO/tests/Cache.py
src/ZEO/tests/Cache.py
+2
-2
src/ZEO/tests/ConnectionTests.py
src/ZEO/tests/ConnectionTests.py
+3
-6
src/ZEO/tests/testTransactionBuffer.py
src/ZEO/tests/testTransactionBuffer.py
+4
-4
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+1
-4
No files found.
src/ZEO/ClientStorage.py
View file @
03498c05
...
...
@@ -54,8 +54,6 @@ logger = logging.getLogger(__name__)
# max signed 64-bit value ~ infinity :) Signed cuz LBTree and TimeStamp
m64
=
b'
\
x7f
\
xff
\
xff
\
xff
\
xff
\
xff
\
xff
\
xff
'
from
ZODB.ConflictResolution
import
ResolvedSerial
def
tid2time
(
tid
):
return
str
(
TimeStamp
(
tid
))
...
...
@@ -748,7 +746,7 @@ class ClientStorage(ZODB.ConflictResolution.ConflictResolvingStorage):
self
.
_async
(
'storea'
,
oid
,
committed
,
data
,
id
(
txn
))
tbuf
.
resolve
(
oid
,
data
)
else
:
tbuf
.
ser
ial
(
oid
,
ResolvedSerial
)
tbuf
.
ser
ver_resolve
(
oid
)
vote_attempts
+=
1
...
...
src/ZEO/StorageServer.py
View file @
03498c05
...
...
@@ -42,7 +42,6 @@ from ZEO._compat import Pickler, Unpickler, PY3, BytesIO
from
ZEO.Exceptions
import
AuthError
from
ZEO.monitor
import
StorageStats
from
ZEO.asyncio.server
import
Delay
,
MTDelay
,
Result
from
ZODB.ConflictResolution
import
ResolvedSerial
from
ZODB.loglevels
import
BLATHER
from
ZODB.POSException
import
StorageError
,
StorageTransactionError
from
ZODB.POSException
import
TransactionError
,
ReadOnlyError
,
ConflictError
...
...
src/ZEO/TransactionBuffer.py
View file @
03498c05
...
...
@@ -25,8 +25,6 @@ import os
import
tempfile
import
ZODB.blob
from
ZODB.ConflictResolution
import
ResolvedSerial
from
ZEO._compat
import
Pickler
,
Unpickler
class
TransactionBuffer
:
...
...
@@ -66,11 +64,8 @@ class TransactionBuffer:
self
.
store
(
oid
,
data
)
self
.
client_resolved
[
oid
]
=
self
.
count
-
1
def
serial
(
self
,
oid
,
serial
):
if
isinstance
(
serial
,
Exception
):
self
.
exception
=
serial
# This transaction will never be committed
elif
serial
==
ResolvedSerial
:
self
.
server_resolved
.
add
(
oid
)
def
server_resolve
(
self
,
oid
):
self
.
server_resolved
.
add
(
oid
)
def
storeBlob
(
self
,
oid
,
blobfilename
):
self
.
blobs
.
append
((
oid
,
blobfilename
))
...
...
src/ZEO/asyncio/client.py
View file @
03498c05
...
...
@@ -6,7 +6,6 @@ else:
import
trollius
as
asyncio
from
ZEO.Exceptions
import
ClientDisconnected
from
ZODB.ConflictResolution
import
ResolvedSerial
import
concurrent.futures
import
functools
import
logging
...
...
src/ZEO/tests/Cache.py
View file @
03498c05
...
...
@@ -44,8 +44,8 @@ class TransUndoStorageWithCache:
self
.
_storage
.
tpc_finish
(
t
)
assert
len
(
oids
)
==
1
assert
oids
[
0
]
==
oid
[
uoid
]
=
oids
assert
uoid
==
oid
data
,
revid
=
self
.
_storage
.
load
(
oid
,
''
)
obj
=
zodb_unpickle
(
data
)
assert
obj
==
MinPO
(
24
)
src/ZEO/tests/ConnectionTests.py
View file @
03498c05
...
...
@@ -28,8 +28,7 @@ from ZODB.DB import DB
from
ZODB.POSException
import
ReadOnlyError
,
ConflictError
from
ZODB.tests.StorageTestBase
import
StorageTestBase
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
\
import
zodb_pickle
,
zodb_unpickle
,
handle_all_serials
,
handle_serials
from
ZODB.tests.StorageTestBase
import
zodb_pickle
,
zodb_unpickle
import
ZODB.tests.util
import
transaction
...
...
@@ -1065,14 +1064,12 @@ class MSTThread(threading.Thread):
data
=
MinPO
(
"%s.%s.t%d.o%d"
%
(
tname
,
c
.
__name
,
i
,
j
))
#print(data.value)
data
=
zodb_pickle
(
data
)
s
=
c
.
store
(
oid
,
ZERO
,
data
,
''
,
t
)
c
.
__serials
.
update
(
handle_all_serials
(
oid
,
s
))
c
.
store
(
oid
,
ZERO
,
data
,
''
,
t
)
# Vote on all servers and handle serials
for
c
in
clients
:
#print("%s.%s.%s vote" % (tname, c.__name, i))
s
=
c
.
tpc_vote
(
t
)
c
.
__serials
.
update
(
handle_all_serials
(
None
,
s
))
c
.
tpc_vote
(
t
)
# Finish on all servers
for
c
in
clients
:
...
...
src/ZEO/tests/testTransactionBuffer.py
View file @
03498c05
...
...
@@ -14,7 +14,6 @@
import
random
import
unittest
from
ZODB.ConflictResolution
import
ResolvedSerial
from
ZEO.TransactionBuffer
import
TransactionBuffer
def
random_string
(
size
):
...
...
@@ -26,10 +25,11 @@ def new_store_data():
"""Return arbitrary data to use as argument to store() method."""
return
random_string
(
8
),
random_string
(
random
.
randrange
(
1000
))
def
store
(
tbuf
,
serial
=
Non
e
):
def
store
(
tbuf
,
resolved
=
Fals
e
):
data
=
new_store_data
()
tbuf
.
store
(
*
data
)
tbuf
.
serial
(
data
[
0
],
serial
)
if
resolved
:
tbuf
.
server_resolve
(
data
[
0
])
return
data
class
TransBufTests
(
unittest
.
TestCase
):
...
...
@@ -46,7 +46,7 @@ class TransBufTests(unittest.TestCase):
data
=
[]
for
i
in
range
(
10
):
data
.
append
((
store
(
tbuf
),
False
))
data
.
append
((
store
(
tbuf
,
ResolvedSerial
),
True
))
data
.
append
((
store
(
tbuf
,
True
),
True
))
for
i
,
(
oid
,
d
,
resolved
)
in
enumerate
(
tbuf
):
self
.
assertEqual
((
oid
,
d
),
data
[
i
][
0
])
...
...
src/ZEO/tests/testZEO.py
View file @
03498c05
...
...
@@ -538,7 +538,6 @@ class CommonBlobTests:
def
checkStoreBlob
(
self
):
import
transaction
from
ZODB.blob
import
Blob
from
ZODB.tests.StorageTestBase
import
handle_serials
from
ZODB.tests.StorageTestBase
import
ZERO
from
ZODB.tests.StorageTestBase
import
zodb_pickle
...
...
@@ -579,8 +578,7 @@ class CommonBlobTests:
def
checkLoadBlob
(
self
):
from
ZODB.blob
import
Blob
from
ZODB.tests.StorageTestBase
import
zodb_pickle
,
ZERO
,
\
handle_serials
from
ZODB.tests.StorageTestBase
import
zodb_pickle
,
ZERO
import
transaction
somedata
=
b'a'
*
10
...
...
@@ -629,7 +627,6 @@ class BlobAdaptedFileStorageTests(FullGenericTests, CommonBlobTests):
def
checkStoreAndLoadBlob
(
self
):
import
transaction
from
ZODB.blob
import
Blob
from
ZODB.tests.StorageTestBase
import
handle_serials
from
ZODB.tests.StorageTestBase
import
ZERO
from
ZODB.tests.StorageTestBase
import
zodb_pickle
...
...
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