Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
f4725366
Commit
f4725366
authored
Mar 16, 2020
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qa: add testProtocolVersionMismatch
parent
43029be2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
neo/storage/replicator.py
neo/storage/replicator.py
+1
-1
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+16
-1
No files found.
neo/storage/replicator.py
View file @
f4725366
...
@@ -63,7 +63,7 @@ Which has in turn other consequences:
...
@@ -63,7 +63,7 @@ Which has in turn other consequences:
received yet a notification from the master).
received yet a notification from the master).
- Writes must be accepted blindly (i.e. without taking a write-lock) when a
- Writes must be accepted blindly (i.e. without taking a write-lock) when a
storage node lacks the data to check for conflicts. This is possible because
storage node lacks the data to check for conflicts. This is possible because
1
up-to-dat
e cell (for each partition) is enough to do these checks.
1
readabl
e cell (for each partition) is enough to do these checks.
- Because the client can not reliably know if a storage node is expected to
- Because the client can not reliably know if a storage node is expected to
receive a transaction in full, all writes must succeed.
receive a transaction in full, all writes must succeed.
- Even if the replication is finished, we have to wait that we don't have any
- Even if the replication is finished, we have to wait that we don't have any
...
...
neo/tests/threaded/test.py
View file @
f4725366
...
@@ -29,7 +29,7 @@ from ZODB import DB, POSException
...
@@ -29,7 +29,7 @@ from ZODB import DB, POSException
from
ZODB.DB
import
TransactionalUndo
from
ZODB.DB
import
TransactionalUndo
from
neo.storage.transactions
import
TransactionManager
,
ConflictError
from
neo.storage.transactions
import
TransactionManager
,
ConflictError
from
neo.lib.connection
import
ConnectionClosed
,
\
from
neo.lib.connection
import
ConnectionClosed
,
\
ServerConnection
,
MTClientConnection
ClientConnection
,
ServerConnection
,
MTClientConnection
from
neo.lib.exception
import
StoppedOperation
from
neo.lib.exception
import
StoppedOperation
from
neo.lib.handler
import
DelayEvent
,
EventHandler
from
neo.lib.handler
import
DelayEvent
,
EventHandler
from
neo.lib
import
logging
from
neo.lib
import
logging
...
@@ -2965,6 +2965,21 @@ class Test(NEOThreadedTest):
...
@@ -2965,6 +2965,21 @@ class Test(NEOThreadedTest):
for
i
,
s
in
zip
(
nid_list
,
cluster
.
storage_list
):
for
i
,
s
in
zip
(
nid_list
,
cluster
.
storage_list
):
self
.
assertMultiLineEqual
(
s
.
dm
.
dump
(),
dump_dict
[
i
])
self
.
assertMultiLineEqual
(
s
.
dm
.
dump
(),
dump_dict
[
i
])
def
testProtocolVersionMismatch
(
self
):
def
ConnectorClass
(
cls
,
conn
,
*
args
):
connector
=
cls
(
*
args
)
x
=
connector
.
queued
[
0
]
connector
.
queued
[
0
]
=
x
[:
-
1
]
+
chr
(
ord
(
x
[
-
1
])
^
1
)
return
connector
with
Patch
(
ClientConnection
,
ConnectorClass
=
ConnectorClass
),
\
self
.
getLoopbackConnection
()
as
conn
:
for
_
in
xrange
(
9
):
if
conn
.
isClosed
():
break
conn
.
em
.
poll
(
1
)
else
:
self
.
fail
(
'%r not closed'
%
conn
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
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