When Elasticsearch nodes are started in gradle to form a

cluster, we wait for the cluster health to indicate the
necessary nodes have formed a cluster.  This check was an
exact value (equality) check.  However, if we are trying to
connect the nodes in the cluster to nodes from a previously
formed cluster (of the same name), then we will have more
nodes returned by the cluster health check than the current
task's configured number of nodes.  Hence, this check needs
to be a >= check.  This commit fixes it.
This commit is contained in:
Ali Beyad 2016-09-15 18:52:15 -04:00
parent ec7e383783
commit ba072ec18e
4 changed files with 9 additions and 6 deletions

View File

@ -95,6 +95,7 @@ class ClusterConfiguration {
@Input
Closure waitCondition = { NodeInfo node, AntBuilder ant ->
File tmpFile = new File(node.cwd, 'wait.success')
ant.echo("==> Current time: " + new Date());
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=${numNodes}",
dest: tmpFile.toString(),
ignoreerrors: true, // do not fail on error, so logging buffers can be flushed by the wait task

View File

@ -25,8 +25,12 @@ task oldClusterTest(type: RestIntegTestTask) {
mustRunAfter(precommit)
cluster {
distribution = 'zip'
bwcVersion = '5.0.0-alpha5' // TODO: either randomize, or make this settable with sysprop
numBwcNodes = 2
// TODO: Right now, this just forms a cluster with the current version of ES,
// because we don't support clusters with nodes on different alpha/beta releases of ES.
// When the GA is released, we should change the bwcVersion to 5.0.0 and uncomment
// numBwcNodes = 2
//bwcVersion = '5.0.0-alpha5' // TODO: either randomize, or make this settable with sysprop
//numBwcNodes = 2
numNodes = 2
clusterName = 'rolling-upgrade'
}

View File

@ -3,8 +3,7 @@
- do:
cluster.health:
wait_for_status: green
- match: { number_of_nodes: 2 }
wait_for_nodes: 2
- do:
search:

View File

@ -3,8 +3,7 @@
- do:
cluster.health:
wait_for_status: green
- match: { number_of_nodes: 2 }
wait_for_nodes: 2
- do:
search: