The test TestNodeModify temporarily modifies the cluster parameter candidate-pool-size, which controls the minimal desirable number of master candidates. Depending on the size of the test cluster, this temporary modification can be a decrease (for clusters with up to 10 nodes) or an increase (for clusters with 12 or more nodes). Ganeti's behavior upon change of the candidate pool size is to promote nodes to master candidates upon increase, but do nothing upon decrease. This is a safe behavior, as too many master candidates is not a problem; the chance of data loss is even smaller. However, it means that the test has a size effect of, for large test cluster, increasing the actual number of nodes that are master candidates. While not a problem for correctness, this side effect does affect our performance tests (which usually are run after the functional tests) as more master candidates means more nodes to replicate information to.
Signed-off-by: Klaus Aehlig <[email protected]> --- qa/qa_node.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qa/qa_node.py b/qa/qa_node.py index d1d1403..1ed6bbe 100644 --- a/qa/qa_node.py +++ b/qa/qa_node.py @@ -284,6 +284,16 @@ def TestNodeModify(node): AssertCommand(["gnt-cluster", "modify", "--candidate-pool-size=%s" % default_pool_size]) + # For test clusters with more nodes than the default pool size, + # we now have too many master candidates. To readjust to the original + # size, manually demote all nodes and rely on auto-promotion to adjust. + if len(nodes) > default_pool_size: + master = qa_config.GetMasterNode() + for n in nodes: + if n.primary != master.primary: + AssertCommand(["gnt-node", "modify", "--master-candidate=no", + "--auto-promote", n.primary]) + def _CreateOobScriptStructure(): """Create a simple OOB handling script and its structure.""" -- 2.6.0.rc2.230.g3dd15c0
