Commit 509bccf3 authored by Vincent Pelletier's avatar Vincent Pelletier

Only mark master nodes are running before the first election attempt.

Hence, don't add non-running nodes to unconnected_master_node_set before each election attempt.
Preserve negotiating_master_node_set between attemps to reuse possibly pending connections.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1183 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d637c812
...@@ -147,17 +147,19 @@ class Application(object): ...@@ -147,17 +147,19 @@ class Application(object):
em = self.em em = self.em
nm = self.nm nm = self.nm
for node in nm.getMasterNodeList():
# For now, believe that every node should be available,
# since down or broken nodes may be already repaired.
node.setState(RUNNING_STATE)
while 1: while 1:
t = 0 t = 0
self.primary = None self.primary = None
self.primary_master_node = None self.primary_master_node = None
for node in nm.getMasterNodeList(): for node in nm.getMasterNodeList():
self.unconnected_master_node_set.add(node.getServer()) if node.getState() == RUNNING_STATE:
# For now, believe that every node should be available, self.unconnected_master_node_set.add(node.getServer())
# since down or broken nodes may be already repaired.
node.setState(RUNNING_STATE)
self.negotiating_master_node_set.clear()
# Expire temporarily down nodes. For now, assume that a node # Expire temporarily down nodes. For now, assume that a node
# which is down for 60 seconds is really down, if this is a # which is down for 60 seconds is really down, if this is a
......
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