Skip to content

Commit ef0dd2d

Browse files
committed
Merge remote-tracking branch 'elastic/6.x' into hard-coded-ports-are-bad-mkay
* elastic/6.x: [ML] Wait for ML indices in rolling upgrade tests (elastic#30615) Watcher: Ensure secrets integration tests also run triggered watch (elastic#30478) Move allocation awareness attributes to list setting (elastic#30626) [Docs] Update code snippet in has-child-query.asciidoc (elastic#30510) Allow date math for naming newly-created snapshots (elastic#7939) (elastic#30479) Awaits fix a failing test Switch many QA projects to use new style requests (elastic#30574) QA: System property to override distribution (elastic#30591)
2 parents a108125 + c2e0061 commit ef0dd2d

File tree

34 files changed

+305
-152
lines changed

34 files changed

+305
-152
lines changed

docs/java-api/query-dsl/has-child-query.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ When using the `has_child` query it is important to use the `PreBuiltTransportCl
99
--------------------------------------------------
1010
Settings settings = Settings.builder().put("cluster.name", "elasticsearch").build();
1111
TransportClient client = new PreBuiltTransportClient(settings);
12-
client.addTransportAddress(new InetSocketTransportAddress(new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 9300)));
12+
client.addTransportAddress(new TransportAddress(new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 9300)));
1313
--------------------------------------------------
1414

1515
Otherwise the parent-join module doesn't get loaded and the `has_child` query can't be used from the transport client.

docs/reference/modules/snapshots.asciidoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,20 @@ By setting `include_global_state` to false it's possible to prevent the cluster
289289
the snapshot. By default, the entire snapshot will fail if one or more indices participating in the snapshot don't have
290290
all primary shards available. This behaviour can be changed by setting `partial` to `true`.
291291

292+
Snapshot names can be automatically derived using <<date-math-index-names,date math expressions>>, similarly as when creating
293+
new indices. Note that special characters need to be URI encoded.
294+
295+
For example, creating a snapshot with the current day in the name, like `snapshot-2018.05.11`, can be achieved with
296+
the following command:
297+
[source,js]
298+
-----------------------------------
299+
# PUT /_snapshot/my_backup/<snapshot-{now/d}>
300+
PUT /_snapshot/my_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E
301+
-----------------------------------
302+
// CONSOLE
303+
// TEST[continued]
304+
305+
292306
The index snapshot process is incremental. In the process of making the index snapshot Elasticsearch analyses
293307
the list of the index files that are already stored in the repository and copies only files that were created or
294308
changed since the last snapshot. That allows multiple snapshots to be preserved in the repository in a compact form.

plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepositoryDeprecationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
public class GoogleCloudStorageRepositoryDeprecationTests extends ESTestCase {
3333

34+
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/30638")
3435
public void testDeprecatedSettings() throws Exception {
3536
final Settings repositorySettings = Settings.builder()
3637
.put("bucket", "test")

qa/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask
44
subprojects { Project subproj ->
55
subproj.tasks.withType(RestIntegTestTask) {
66
subproj.extensions.configure("${it.name}Cluster") { cluster ->
7-
cluster.distribution = 'oss-zip'
7+
cluster.distribution = System.getProperty('tests.distribution', 'oss-zip')
88
}
99
}
1010
}

qa/ccs-unavailable-clusters/src/test/java/org/elasticsearch/search/CrossClusterSearchUnavailableClusterIT.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.elasticsearch.action.search.SearchRequest;
3636
import org.elasticsearch.action.search.SearchResponse;
3737
import org.elasticsearch.action.search.SearchScrollRequest;
38+
import org.elasticsearch.client.Request;
3839
import org.elasticsearch.client.Response;
3940
import org.elasticsearch.client.ResponseException;
4041
import org.elasticsearch.client.RestClient;
@@ -134,7 +135,7 @@ public void testSearchSkipUnavailable() throws IOException {
134135
for (int i = 0; i < 10; i++) {
135136
restHighLevelClient.index(new IndexRequest("index", "doc", String.valueOf(i)).source("field", "value"));
136137
}
137-
Response refreshResponse = client().performRequest("POST", "/index/_refresh");
138+
Response refreshResponse = client().performRequest(new Request("POST", "/index/_refresh"));
138139
assertEquals(200, refreshResponse.getStatusLine().getStatusCode());
139140

140141
{
@@ -223,10 +224,11 @@ public void testSkipUnavailableDependsOnSeeds() throws IOException {
223224

224225
{
225226
//check that skip_unavailable alone cannot be set
226-
HttpEntity clusterSettingsEntity = buildUpdateSettingsRequestBody(
227-
Collections.singletonMap("skip_unavailable", randomBoolean()));
227+
Request request = new Request("PUT", "/_cluster/settings");
228+
request.setEntity(buildUpdateSettingsRequestBody(
229+
Collections.singletonMap("skip_unavailable", randomBoolean())));
228230
ResponseException responseException = expectThrows(ResponseException.class,
229-
() -> client().performRequest("PUT", "/_cluster/settings", Collections.emptyMap(), clusterSettingsEntity));
231+
() -> client().performRequest(request));
230232
assertEquals(400, responseException.getResponse().getStatusLine().getStatusCode());
231233
assertThat(responseException.getMessage(),
232234
containsString("Missing required setting [search.remote.remote1.seeds] " +
@@ -240,9 +242,10 @@ public void testSkipUnavailableDependsOnSeeds() throws IOException {
240242

241243
{
242244
//check that seeds cannot be reset alone if skip_unavailable is set
243-
HttpEntity clusterSettingsEntity = buildUpdateSettingsRequestBody(Collections.singletonMap("seeds", null));
245+
Request request = new Request("PUT", "/_cluster/settings");
246+
request.setEntity(buildUpdateSettingsRequestBody(Collections.singletonMap("seeds", null)));
244247
ResponseException responseException = expectThrows(ResponseException.class,
245-
() -> client().performRequest("PUT", "/_cluster/settings", Collections.emptyMap(), clusterSettingsEntity));
248+
() -> client().performRequest(request));
246249
assertEquals(400, responseException.getResponse().getStatusLine().getStatusCode());
247250
assertThat(responseException.getMessage(), containsString("Missing required setting [search.remote.remote1.seeds] " +
248251
"for setting [search.remote.remote1.skip_unavailable]"));
@@ -284,8 +287,9 @@ private static void assertSearchConnectFailure() {
284287

285288

286289
private static void updateRemoteClusterSettings(Map<String, Object> settings) throws IOException {
287-
HttpEntity clusterSettingsEntity = buildUpdateSettingsRequestBody(settings);
288-
Response response = client().performRequest("PUT", "/_cluster/settings", Collections.emptyMap(), clusterSettingsEntity);
290+
Request request = new Request("PUT", "/_cluster/settings");
291+
request.setEntity(buildUpdateSettingsRequestBody(settings));
292+
Response response = client().performRequest(request);
289293
assertEquals(200, response.getStatusLine().getStatusCode());
290294
}
291295

qa/die-with-dignity/src/test/java/org/elasticsearch/qa/die_with_dignity/DieWithDignityIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.apache.http.ConnectionClosedException;
2323
import org.apache.lucene.util.Constants;
24+
import org.elasticsearch.client.Request;
2425
import org.elasticsearch.common.io.PathUtils;
2526
import org.elasticsearch.test.rest.ESRestTestCase;
2627
import org.hamcrest.Matcher;
@@ -51,7 +52,8 @@ public void testDieWithDignity() throws Exception {
5152
assertThat(pidFileLines, hasSize(1));
5253
final int pid = Integer.parseInt(pidFileLines.get(0));
5354
Files.delete(pidFile);
54-
IOException e = expectThrows(IOException.class, () -> client().performRequest("GET", "/_die_with_dignity"));
55+
IOException e = expectThrows(IOException.class,
56+
() -> client().performRequest(new Request("GET", "/_die_with_dignity")));
5557
Matcher<IOException> failureMatcher = instanceOf(ConnectionClosedException.class);
5658
if (Constants.WINDOWS) {
5759
/*

qa/mixed-cluster/build.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@ for (Version version : bwcVersions.wireCompatible) {
5757
bwcTest.dependsOn(versionBwcTest)
5858
}
5959

60-
/* To support taking index snapshots, we have to set path.repo setting */
6160
tasks.getByName("${baseName}#mixedClusterTestRunner").configure {
61+
/* To support taking index snapshots, we have to set path.repo setting */
6262
systemProperty 'tests.path.repo', new File(buildDir, "cluster/shared/repo")
63+
if ('zip'.equals(extension.distribution)) {
64+
systemProperty 'tests.rest.blacklist', [
65+
'cat.templates/10_basic/No templates',
66+
'cat.templates/10_basic/Sort templates',
67+
'cat.templates/10_basic/Multiple template',
68+
].join(',')
69+
}
6370
}
6471
}
6572

0 commit comments

Comments
 (0)