Commit f822d7d0 authored by Julien Muchembled's avatar Julien Muchembled

Add a few docstrings

parent f86fbc14
...@@ -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'),
......
...@@ -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):
......
...@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment