Commit b1c4cb6c authored by Grégory Wisniewski's avatar Grégory Wisniewski

Decrease master election timeout, there is no reasons to not take one of the

first master up as primary, then accept the others (lowest) as secondaries.


git-svn-id: https://svn.erp5.org/repos/neo/trunk@1301 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 011b1d5c
...@@ -162,14 +162,13 @@ class Application(object): ...@@ -162,14 +162,13 @@ class Application(object):
if node.getState() == RUNNING_STATE: if node.getState() == RUNNING_STATE:
self.unconnected_master_node_set.add(node.getServer()) self.unconnected_master_node_set.add(node.getServer())
# Expire temporarily down nodes. For now, assume that a node # Wait at most 20 seconds at bootstrap. Otherwise, wait at most
# which is down for 60 seconds is really down, if this is a # 10 seconds to avoid stopping the whole cluster for a long time.
# bootstrap. 60 seconds may sound too long, but this is reasonable # Note that even if not all master are up in the first 20 seconds
# when rebooting many cluster machines. Otherwise, wait for only # this is not an issue because the first up will timeout and take
# 10 seconds, because stopping the whole cluster for a long time # the primary role.
# is a bad idea.
if bootstrap: if bootstrap:
expiration = 60 expiration = 20
else: else:
expiration = 10 expiration = 10
......
...@@ -107,7 +107,7 @@ class MasterTests(NEOFunctionalTest): ...@@ -107,7 +107,7 @@ class MasterTests(NEOFunctionalTest):
first_master.start() first_master.start()
first_master_uuid = first_master.getUUID() first_master_uuid = first_master.getUUID()
# Check that the master node we started elected itself. # Check that the master node we started elected itself.
self.neo.expectPrimaryMaster(first_master_uuid, timeout=60) self.neo.expectPrimaryMaster(first_master_uuid, timeout=30)
# Check that no other node is known as running. # Check that no other node is known as running.
self.assertEqual(len(self.neo.getMasterNodeList( self.assertEqual(len(self.neo.getMasterNodeList(
state=protocol.RUNNING_STATE)), 1) state=protocol.RUNNING_STATE)), 1)
......
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