Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
neoppod
Commits
f822d7d0
Commit
f822d7d0
authored
Jun 23, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a few docstrings
parent
f86fbc14
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
neo/lib/protocol.py
neo/lib/protocol.py
+6
-0
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+7
-0
neo/tests/threaded/testReplication.py
neo/tests/threaded/testReplication.py
+5
-0
No files found.
neo/lib/protocol.py
View file @
f822d7d0
...
@@ -1469,7 +1469,13 @@ class AddObject(Packet):
...
@@ -1469,7 +1469,13 @@ class AddObject(Packet):
class
Replicate
(
Packet
):
class
Replicate
(
Packet
):
"""
"""
Notify a storage node to replicate partitions up to given 'tid'
and from given sources.
M -> S
M -> S
- upstream_name: replicate from an upstream cluster
- address: address of the source storage node, or None if there's no new
data up to 'tid' for the given partition
"""
"""
_fmt
=
PStruct
(
'replicate'
,
_fmt
=
PStruct
(
'replicate'
,
PTID
(
'tid'
),
PTID
(
'tid'
),
...
...
neo/tests/threaded/__init__.py
View file @
f822d7d0
...
@@ -329,6 +329,13 @@ class ClientApplication(Node, neo.client.app.Application):
...
@@ -329,6 +329,13 @@ class ClientApplication(Node, neo.client.app.Application):
self
.
em
.
_lock
=
threading
.
Lock
()
self
.
em
.
_lock
=
threading
.
Lock
()
def
setPoll
(
self
,
master
=
False
):
def
setPoll
(
self
,
master
=
False
):
"""Set whether this thread runs freely or not
The client must be switched in master mode (by passing True) before
doing any synchronous call to the ZODB, otherwise the test deadlocks.
When called with master=False, the cluster is suspended and will only
processe packets upon NEOCluster.tic() calls.
"""
if
master
:
if
master
:
self
.
em
.
_timeout
=
1
self
.
em
.
_timeout
=
1
if
not
self
.
em
.
_lock
.
acquire
(
0
):
if
not
self
.
em
.
_lock
.
acquire
(
0
):
...
...
neo/tests/threaded/testReplication.py
View file @
f822d7d0
...
@@ -263,6 +263,11 @@ class ReplicationTests(NEOThreadedTest):
...
@@ -263,6 +263,11 @@ class ReplicationTests(NEOThreadedTest):
@
backup_test
()
@
backup_test
()
def
testBackupDelayedUnlockTransaction
(
self
,
backup
):
def
testBackupDelayedUnlockTransaction
(
self
,
backup
):
"""
Check that a backup storage node is put on hold by upstream if
the requested transaction is still locked. Such case happens when
the backup cluster reacts very quickly to a new transaction.
"""
upstream
=
backup
.
upstream
upstream
=
backup
.
upstream
with
upstream
.
master
.
filterConnection
(
upstream
.
storage
)
as
f
:
with
upstream
.
master
.
filterConnection
(
upstream
.
storage
)
as
f
:
f
.
add
(
lambda
conn
,
packet
:
f
.
add
(
lambda
conn
,
packet
:
...
...
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