Commit 131a1054 authored by Vincent Pelletier's avatar Vincent Pelletier

Only instanciate Replicator once.

Also, reverts r2197, as it is unclear what bug it was trying to fix, and it
doens't seem required (there is no call to Replicator.act() outside of
doOperation).

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2223 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 37decce5
......@@ -64,7 +64,7 @@ class Application(object):
# partitions.
self.pt = None
self.replicator = None
self.replicator = Replicator(self)
self.listening_conn = None
self.master_conn = None
self.master_node = None
......@@ -176,9 +176,6 @@ class Application(object):
while True:
self.ready = False
self.operational = False
if self.replicator is not None:
# stop the replicator
self.replicator.reset()
if self.master_node is None:
# look for the primary master
self.connectToPrimary()
......@@ -286,8 +283,7 @@ class Application(object):
self.dm.dropUnfinishedData()
self.tm.reset()
# The replicator.
self.replicator = Replicator(self)
self.replicator.populate()
while True:
em.poll(1)
......
......@@ -79,6 +79,13 @@ class Replicator(object):
def __init__(self, app):
self.app = app
def populate(self):
"""
Populate partitions to replicate. Must be called when partition
table is the one accepted by primary master.
Implies a reset.
"""
self.new_partition_dict = self._getOutdatedPartitionList()
self.critical_tid_dict = {}
self.reset()
......
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