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):
if node.getState() == RUNNING_STATE:
self.unconnected_master_node_set.add(node.getServer())
# Expire temporarily down nodes. For now, assume that a node
# which is down for 60 seconds is really down, if this is a
# bootstrap. 60 seconds may sound too long, but this is reasonable
# when rebooting many cluster machines. Otherwise, wait for only
# 10 seconds, because stopping the whole cluster for a long time
# is a bad idea.
# Wait at most 20 seconds at bootstrap. Otherwise, wait at most
# 10 seconds to avoid stopping the whole cluster for a long time.
# Note that even if not all master are up in the first 20 seconds
# this is not an issue because the first up will timeout and take
# the primary role.
if bootstrap:
expiration = 60
expiration = 20
else:
expiration = 10
......
......@@ -107,7 +107,7 @@ class MasterTests(NEOFunctionalTest):
first_master.start()
first_master_uuid = first_master.getUUID()
# 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.
self.assertEqual(len(self.neo.getMasterNodeList(
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