Commit 4ed74d9e authored by Grégory Wisniewski's avatar Grégory Wisniewski

Clarity replicator.act() implementation.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1750 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4c2a63ee
...@@ -204,13 +204,25 @@ class Replicator(object): ...@@ -204,13 +204,25 @@ class Replicator(object):
if self.new_partition_dict: if self.new_partition_dict:
self._askCriticalTID() self._askCriticalTID()
if self.current_partition is None: if self.current_partition is not None:
# I need to choose something. if self.replication_done:
# finish a replication
logging.info('replication is done for %s' %
(self.current_partition.getRID(), ))
self._finishReplication()
return
if self.waiting_for_unfinished_tids: if self.waiting_for_unfinished_tids:
# Still waiting. # Still waiting.
logging.debug('waiting for unfinished tids') logging.debug('waiting for unfinished tids')
return return
elif self.unfinished_tid_list is not None:
if self.unfinished_tid_list is None:
# Ask pending transactions.
logging.debug('asking unfinished tids')
self._askUnfinishedTIDs()
return
# Try to select something. # Try to select something.
for partition in self.partition_dict.values(): for partition in self.partition_dict.values():
if partition.safe(self.unfinished_tid_list): if partition.safe(self.unfinished_tid_list):
...@@ -224,15 +236,6 @@ class Replicator(object): ...@@ -224,15 +236,6 @@ class Replicator(object):
return return
self._startReplication() self._startReplication()
else:
# Ask pending transactions.
logging.debug('asking unfinished tids')
self._askUnfinishedTIDs()
else:
if self.replication_done:
logging.info('replication is done for %s' %
(self.current_partition.getRID(), ))
self._finishReplication()
def removePartition(self, rid): def removePartition(self, rid):
"""This is a callback from OperationEventHandler.""" """This is a callback from OperationEventHandler."""
......
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