Commit 79df9de6 authored by Vincent Pelletier's avatar Vincent Pelletier

Don't duplicate primary master connection on replicator.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2208 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 0f7566ad
...@@ -82,7 +82,6 @@ class Replicator(object): ...@@ -82,7 +82,6 @@ class Replicator(object):
self.new_partition_dict = self._getOutdatedPartitionList() self.new_partition_dict = self._getOutdatedPartitionList()
self.critical_tid_dict = {} self.critical_tid_dict = {}
self.tid_offset = 0 self.tid_offset = 0
self.primary_master_connection = app.master_conn
self.reset() self.reset()
def reset(self): def reset(self):
...@@ -121,7 +120,7 @@ class Replicator(object): ...@@ -121,7 +120,7 @@ class Replicator(object):
(dump(uuid), )) (dump(uuid), ))
def _askCriticalTID(self): def _askCriticalTID(self):
conn = self.primary_master_connection conn = self.app.master_conn
conn.ask(Packets.AskLastIDs()) conn.ask(Packets.AskLastIDs())
uuid = conn.getUUID() uuid = conn.getUUID()
self.critical_tid_dict[uuid] = self.new_partition_dict.values() self.critical_tid_dict[uuid] = self.new_partition_dict.values()
...@@ -136,7 +135,7 @@ class Replicator(object): ...@@ -136,7 +135,7 @@ class Replicator(object):
self.unfinished_tid_list = tid_list self.unfinished_tid_list = tid_list
def _askUnfinishedTIDs(self): def _askUnfinishedTIDs(self):
conn = self.primary_master_connection conn = self.app.master_conn
conn.ask(Packets.AskUnfinishedTransactions()) conn.ask(Packets.AskUnfinishedTransactions())
self.waiting_for_unfinished_tids = True self.waiting_for_unfinished_tids = True
...@@ -185,7 +184,7 @@ class Replicator(object): ...@@ -185,7 +184,7 @@ class Replicator(object):
try: try:
self.partition_dict.pop(self.current_partition.getRID()) self.partition_dict.pop(self.current_partition.getRID())
# Notify to a primary master node that my cell is now up-to-date. # Notify to a primary master node that my cell is now up-to-date.
conn = self.primary_master_connection conn = self.app.master_conn
offset = self.current_partition.getRID() offset = self.current_partition.getRID()
conn.notify(Packets.NotifyReplicationDone(offset)) conn.notify(Packets.NotifyReplicationDone(offset))
except KeyError: except KeyError:
......
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