Skip to content

Commit 241ab1b

Browse files
committed
Merge branch 'master' into check-for-close
* master: update Lucene version for 6.0-RC2 version Calculate and cache result when advanceExact is called (elastic#26920) Test query builder bwc against previous supported versions instead of just the current version. Set minimum_master_nodes on rolling-upgrade test (elastic#26911) Return List instead of an array from settings (elastic#26903) remove _primary and _replica shard preferences (elastic#26791) fixing typo in datehistogram-aggregation.asciidoc (elastic#26924) [API] Added the `terminate_after` parameter to the REST spec for "Count" API Setup debug logging for qa.full-cluster-restart Enable BWC testing against other remotes
2 parents 2e658c8 + 96823b0 commit 241ab1b

File tree

113 files changed

+565
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+565
-709
lines changed

TESTING.asciidoc

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -472,28 +472,30 @@ is tested depends on the branch. On master, this will test against the current
472472
stable branch. On the stable branch, it will test against the latest release
473473
branch. Finally, on a release branch, it will test against the most recent release.
474474

475-
=== BWC Testing against a specific branch
475+
=== BWC Testing against a specific remote/branch
476476

477477
Sometimes a backward compatibility change spans two versions. A common case is a new functionality
478478
that needs a BWC bridge in and an unreleased versioned of a release branch (for example, 5.x).
479-
To test the changes, you can instruct gradle to build the BWC version from a local branch instead of
480-
pulling the release branch from GitHub. You do so using the `tests.bwc.refspec` system property:
479+
To test the changes, you can instruct gradle to build the BWC version from a another remote/branch combination instead of
480+
pulling the release branch from GitHub. You do so using the `tests.bwc.remote` and `tests.bwc.refspec` system properties:
481481

482482
-------------------------------------------------
483-
gradle check -Dtests.bwc.refspec=origin/index_req_bwc_5.x
483+
gradle check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec=index_req_bwc_5.x
484484
-------------------------------------------------
485485

486-
The branch needs to be available on the local clone that the BWC makes of the repository you run the
487-
tests from. Using the `origin` remote is a handy trick to make sure that a branch is available
488-
and is up to date in the case of multiple runs.
486+
The branch needs to be available on the remote that the BWC makes of the
487+
repository you run the tests from. Using the remote is a handy trick to make
488+
sure that a branch is available and is up to date in the case of multiple runs.
489489

490490
Example:
491491

492-
Say you need to make a change to `master` and have a BWC layer in `5.x`. You will need to:
493-
. Create a branch called `index_req_change` off `master`. This will contain your change.
492+
Say you need to make a change to `master` and have a BWC layer in `5.x`. You
493+
will need to:
494+
. Create a branch called `index_req_change` off your remote `${remote}`. This
495+
will contain your change.
494496
. Create a branch called `index_req_bwc_5.x` off `5.x`. This will contain your bwc layer.
495-
. If not running the tests locally, push both branches to your remote repository.
496-
. Run the tests with `gradle check -Dtests.bwc.refspec=origin/index_req_bwc_5.x`
497+
. Push both branches to your remote repository.
498+
. Run the tests with `gradle check -Dtests.bwc.remote=${remote} -Dtests.bwc.refspec=index_req_bwc_5.x`.
497499

498500
== Coverage analysis
499501

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,11 @@ class ClusterConfiguration {
6363
boolean debug = false
6464

6565
/**
66-
* if <code>true</code> each node will be configured with <tt>discovery.zen.minimum_master_nodes</tt> set
67-
* to the total number of nodes in the cluster. This will also cause that each node has `0s` state recovery
68-
* timeout which can lead to issues if for instance an existing clusterstate is expected to be recovered
69-
* before any tests start
66+
* Configuration of the setting <tt>discovery.zen.minimum_master_nodes</tt> on the nodes.
67+
* In case of more than one node, this defaults to (number of nodes / 2) + 1
7068
*/
7169
@Input
72-
boolean useMinimumMasterNodes = true
70+
Closure<Integer> minimumMasterNodes = { getNumNodes() > 1 ? getNumNodes().intdiv(2) + 1 : -1 }
7371

7472
@Input
7573
String jvmArgs = "-Xms" + System.getProperty('tests.heap.size', '512m') +

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,14 @@ class ClusterFormationTasks {
311311
// Define a node attribute so we can test that it exists
312312
'node.attr.testattr' : 'test'
313313
]
314-
// we set min master nodes to the total number of nodes in the cluster and
315-
// basically skip initial state recovery to allow the cluster to form using a realistic master election
316-
// this means all nodes must be up, join the seed node and do a master election. This will also allow new and
317-
// old nodes in the BWC case to become the master
318-
if (node.config.useMinimumMasterNodes && node.config.numNodes > 1) {
319-
esConfig['discovery.zen.minimum_master_nodes'] = node.config.numNodes
320-
esConfig['discovery.initial_state_timeout'] = '0s' // don't wait for state.. just start up quickly
314+
int minimumMasterNodes = node.config.minimumMasterNodes.call()
315+
if (minimumMasterNodes > 0) {
316+
esConfig['discovery.zen.minimum_master_nodes'] = minimumMasterNodes
317+
}
318+
if (node.config.numNodes > 1) {
319+
// don't wait for state.. just start up quickly
320+
// this will also allow new and old nodes in the BWC case to become the master
321+
esConfig['discovery.initial_state_timeout'] = '0s'
321322
}
322323
esConfig['node.max_local_storage_nodes'] = node.config.numNodes
323324
esConfig['http.port'] = node.config.httpPort

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ public NoopSearchRequestBuilder setRouting(String... routing) {
142142

143143
/**
144144
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
145-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
146-
* a custom value, which guarantees that the same order will be used across different requests.
145+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
146+
* will be used across different requests.
147147
*/
148148
public NoopSearchRequestBuilder setPreference(String preference) {
149149
request.preference(preference);

core/src/main/java/org/elasticsearch/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public class Version implements Comparable<Version> {
115115
new Version(V_6_0_0_rc1_ID, org.apache.lucene.util.Version.LUCENE_7_0_0);
116116
public static final int V_6_0_0_rc2_ID = 6000052;
117117
public static final Version V_6_0_0_rc2 =
118-
new Version(V_6_0_0_rc2_ID, org.apache.lucene.util.Version.LUCENE_7_0_0);
118+
new Version(V_6_0_0_rc2_ID, org.apache.lucene.util.Version.LUCENE_7_0_1);
119119
public static final int V_6_1_0_ID = 6010099;
120120
public static final Version V_6_1_0 =
121121
new Version(V_6_1_0_ID, org.apache.lucene.util.Version.LUCENE_7_1_0);

core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public ClusterSearchShardsRequest routing(String... routings) {
146146

147147
/**
148148
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
149-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
150-
* a custom value, which guarantees that the same order will be used across different requests.
149+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
150+
* will be used across different requests.
151151
*/
152152
public ClusterSearchShardsRequest preference(String preference) {
153153
this.preference = preference;

core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public ClusterSearchShardsRequestBuilder setRouting(String... routing) {
5555

5656
/**
5757
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
58-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
59-
* a custom value, which guarantees that the same order will be used across different requests.
58+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
59+
* will be used across different requests.
6060
*/
6161
public ClusterSearchShardsRequestBuilder setPreference(String preference) {
6262
request.preference(preference);

core/src/main/java/org/elasticsearch/action/get/GetRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public GetRequest routing(String routing) {
152152

153153
/**
154154
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
155-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
156-
* a custom value, which guarantees that the same order will be used across different requests.
155+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
156+
* will be used across different requests.
157157
*/
158158
public GetRequest preference(String preference) {
159159
this.preference = preference;

core/src/main/java/org/elasticsearch/action/get/GetRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public GetRequestBuilder setRouting(String routing) {
7676

7777
/**
7878
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
79-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
80-
* a custom value, which guarantees that the same order will be used across different requests.
79+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
80+
* will be used across different requests.
8181
*/
8282
public GetRequestBuilder setPreference(String preference) {
8383
request.preference(preference);

core/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ public ActionRequestValidationException validate() {
284284

285285
/**
286286
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
287-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
288-
* a custom value, which guarantees that the same order will be used across different requests.
287+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
288+
* will be used across different requests.
289289
*/
290290
public MultiGetRequest preference(String preference) {
291291
this.preference = preference;

0 commit comments

Comments
 (0)