Skip to content

Commit 52d9012

Browse files
committed
Merge branch 'master' into ccr
* master: Do not check for object existence when deleting repository index files (#31680) Remove extra check for object existence in repository-gcs read object (#31661) Support multiple system store types (#31650) [Test] Clean up some repository-s3 tests (#31601) [Docs] Use capital letters in section headings (#31678) [DOCS] Add PQL language Plugin (#31237) Merge AzureStorageService and AzureStorageServiceImpl and clean up tests (#31607) TEST: Fix test task invocation (#31657) Revert "[TEST] Mute failing tests in NativeRealmInteg and ReservedRealmInteg" Fix RealmInteg test failures Extend allowed characters for grok field names (#21745) (#31653) [DOCS] Fix licensing API details (#31667) [TEST] Mute failing tests in NativeRealmInteg and ReservedRealmInteg Fix CreateSnapshotRequestTests Failure (#31630) Configurable password hashing algorithm/cost (#31234) [TEST] Mute failing NamingConventionsTaskIT tests [DOCS] Replace CONFIG_DIR with ES_PATH_CONF (#31635) Core: Require all actions have a Task (#31627)
2 parents 8ecfcc3 + 8fa0629 commit 52d9012

File tree

116 files changed

+1739
-2198
lines changed

Some content is hidden

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

116 files changed

+1739
-2198
lines changed

buildSrc/src/test/java/org/elasticsearch/gradle/precommit/NamingConventionsTaskIT.java

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.gradle.testkit.runner.BuildResult;
55
import org.gradle.testkit.runner.GradleRunner;
66
import org.gradle.testkit.runner.TaskOutcome;
7+
import org.junit.Ignore;
78

89
import java.util.Arrays;
910

@@ -21,6 +22,7 @@ public void testPluginCanBeApplied() {
2122
assertTrue(output, output.contains("build plugin can be applied"));
2223
}
2324

25+
@Ignore("AwaitsFix : https://github.com/elastic/elasticsearch/issues/31665")
2426
public void testNameCheckFailsAsItShould() {
2527
BuildResult result = GradleRunner.create()
2628
.withProjectDir(getProjectDir("namingConventionsSelfTest"))
@@ -46,6 +48,7 @@ public void testNameCheckFailsAsItShould() {
4648
}
4749
}
4850

51+
@Ignore("AwaitsFix : https://github.com/elastic/elasticsearch/issues/31665")
4952
public void testNameCheckFailsAsItShouldWithMain() {
5053
BuildResult result = GradleRunner.create()
5154
.withProjectDir(getProjectDir("namingConventionsSelfTest"))

client/benchmark/build.gradle

+1-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ mainClassName = 'org.elasticsearch.client.benchmark.BenchmarkMain'
4646

4747

4848
// never try to invoke tests on the benchmark project - there aren't any
49-
check.dependsOn.remove(test)
50-
// explicitly override the test task too in case somebody invokes 'gradle test' so it won't trip
51-
task test(type: Test, overwrite: true)
49+
test.enabled = false
5250

5351
dependencies {
5452
compile 'org.apache.commons:commons-math3:3.2'

docs/plugins/api.asciidoc

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ A number of plugins have been contributed by our community:
2626
* https://github.com/NLPchina/elasticsearch-sql/[SQL language Plugin]:
2727
Allows Elasticsearch to be queried with SQL (by nlpcn)
2828

29+
* https://github.com/ritesh-kapoor/elasticsearch-pql[PQL language Plugin]:
30+
Allows Elasticsearch to be queried with simple pipeline query syntax.
31+
2932
* https://github.com/codelibs/elasticsearch-taste[Elasticsearch Taste Plugin]:
3033
Mahout Taste-based Collaborative Filtering implementation (by CodeLibs Project)
3134

docs/reference/licensing/get-trial-status.asciidoc

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ This API enables you to check the status of your trial license.
1313
[float]
1414
==== Description
1515

16-
If a license is not already registered for the cluster, one is generated when
17-
the nodes start. By default, this is a 30-day trial license that gives access
18-
to all {xpack} features.
16+
If you want to try the features that are included in a platinum license, you can
17+
start a 30-day trial.
1918

2019
NOTE: You are allowed to initiate a trial license only if your cluster has not
21-
already activated a trial license for the current major X-Pack version. For
20+
already activated a trial license for the current major product version. For
2221
example, if you have already activated a trial for v6.0, you cannot start a new
2322
trial until v7.0. You can, however, contact `[email protected]` to request an
2423
extended trial license.

docs/reference/licensing/start-basic.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This API starts an indefinite basic license.
1414
==== Description
1515

1616
The `start basic` API enables you to initiate an indefinite basic license, which
17-
gives access to all {xpack} basic features. If the basic license does not support
17+
gives access to all the basic features. If the basic license does not support
1818
all of the features that are available with your current license, however, you are
1919
notified in the response. You must then re-submit the API request with the
2020
`acknowledge` parameter set to `true`.

docs/reference/licensing/start-trial.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ This API starts a 30-day trial license.
1414
==== Description
1515

1616
The `start trial` API enables you to upgrade from a basic license to a 30-day
17-
trial license, which gives access to all {xpack} features.
17+
trial license, which gives access to the platinum features.
1818

1919
NOTE: You are allowed to initiate a trial license only if your cluster has not
20-
already activated a trial license for the current major X-Pack version. For
20+
already activated a trial license for the current major product version. For
2121
example, if you have already activated a trial for v6.0, you cannot start a new
2222
trial until v7.0. You can, however, contact `[email protected]` to request an
2323
extended trial license.

docs/reference/settings/security-settings.asciidoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ role mappings are not considered. Defaults to `false`.
328328
`files.role_mapping`::
329329
The {xpack-ref}/security-files.html[location] for the {xpack-ref}/mapping-roles.html#mapping-roles[
330330
YAML role mapping configuration file]. Defaults to
331-
`CONFIG_DIR/role_mapping.yml`.
331+
`ES_PATH_CONF/role_mapping.yml`.
332332

333333
`follow_referrals`::
334334
Specifies whether {security} should follow referrals returned
@@ -494,7 +494,7 @@ considered. Defaults to `false`.
494494

495495
`files.role_mapping`::
496496
The {xpack-ref}/security-files.html[location] for the YAML
497-
role mapping configuration file. Defaults to `CONFIG_DIR/role_mapping.yml`.
497+
role mapping configuration file. Defaults to `ES_PATH_CONF/role_mapping.yml`.
498498

499499
`user_search.base_dn`::
500500
The context to search for a user. Defaults to the root
@@ -719,7 +719,7 @@ for SSL. This setting cannot be used with `certificate_authorities`.
719719
`files.role_mapping`::
720720
Specifies the {xpack-ref}/security-files.html[location] of the
721721
{xpack-ref}/mapping-roles.html[YAML role mapping configuration file].
722-
Defaults to `CONFIG_DIR/role_mapping.yml`.
722+
Defaults to `ES_PATH_CONF/role_mapping.yml`.
723723

724724
`cache.ttl`::
725725
Specifies the time-to-live for cached user entries. A user and a hash of its

docs/reference/testing/testing-framework.asciidoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ If your test is a well isolated unit test which doesn't need a running Elasticse
5454

5555

5656
[[integration-tests]]
57-
=== integration tests
57+
=== Integration tests
5858

5959
These kind of tests require firing up a whole cluster of nodes, before the tests can actually be run. Compared to unit tests they are obviously way more time consuming, but the test infrastructure tries to minimize the time cost by only restarting the whole cluster, if this is configured explicitly.
6060

6161
The class your tests have to inherit from is `ESIntegTestCase`. By inheriting from this class, you will no longer need to start Elasticsearch nodes manually in your test, although you might need to ensure that at least a certain number of nodes are up. The integration test behaviour can be configured heavily by specifying different system properties on test runs. See the `TESTING.asciidoc` documentation in the https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc[source repository] for more information.
6262

6363

6464
[[number-of-shards]]
65-
==== number of shards
65+
==== Number of shards
6666

6767
The number of shards used for indices created during integration tests is randomized between `1` and `10` unless overwritten upon index creation via index settings.
6868
The rule of thumb is not to specify the number of shards unless needed, so that each test will use a different one all the time. Alternatively you can override the `numberOfShards()` method. The same applies to the `numberOfReplicas()` method.
6969

7070

7171
[[helper-methods]]
72-
==== generic helper methods
72+
==== Generic helper methods
7373

7474
There are a couple of helper methods in `ESIntegTestCase`, which will make your tests shorter and more concise.
7575

@@ -88,7 +88,7 @@ There are a couple of helper methods in `ESIntegTestCase`, which will make your
8888

8989

9090
[[test-cluster-methods]]
91-
==== test cluster methods
91+
==== Test cluster methods
9292

9393
The `InternalTestCluster` class is the heart of the cluster functionality in a randomized test and allows you to configure a specific setting or replay certain types of outages to check, how your custom code reacts.
9494

libs/grok/src/main/java/org/elasticsearch/grok/Grok.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class Grok {
5252
"%\\{" +
5353
"(?<name>" +
5454
"(?<pattern>[A-z0-9]+)" +
55-
"(?::(?<subname>[A-z0-9_:.-]+))?" +
55+
"(?::(?<subname>[[:alnum:]@\\[\\]_:.-]+))?" +
5656
")" +
5757
"(?:=(?<definition>" +
5858
"(?:" +
@@ -81,11 +81,11 @@ public final class Grok {
8181
public Grok(Map<String, String> patternBank, String grokPattern) {
8282
this(patternBank, grokPattern, true, ThreadWatchdog.noop());
8383
}
84-
84+
8585
public Grok(Map<String, String> patternBank, String grokPattern, ThreadWatchdog threadWatchdog) {
8686
this(patternBank, grokPattern, true, threadWatchdog);
8787
}
88-
88+
8989
Grok(Map<String, String> patternBank, String grokPattern, boolean namedCaptures) {
9090
this(patternBank, grokPattern, namedCaptures, ThreadWatchdog.noop());
9191
}

libs/grok/src/test/java/org/elasticsearch/grok/GrokTests.java

+48-2
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,10 @@ public void testMultipleNamedCapturesWithSameName() {
412412
expected.put("num", "1");
413413
assertThat(grok.captures("12"), equalTo(expected));
414414
}
415-
415+
416416
public void testExponentialExpressions() {
417417
AtomicBoolean run = new AtomicBoolean(true); // to avoid a lingering thread when test has completed
418-
418+
419419
String grokPattern = "Bonsuche mit folgender Anfrage: Belegart->\\[%{WORD:param2},(?<param5>(\\s*%{NOTSPACE})*)\\] " +
420420
"Zustand->ABGESCHLOSSEN Kassennummer->%{WORD:param9} Bonnummer->%{WORD:param10} Datum->%{DATESTAMP_OTHER:param11}";
421421
String logLine = "Bonsuche mit folgender Anfrage: Belegart->[EINGESCHRAENKTER_VERKAUF, VERKAUF, NACHERFASSUNG] " +
@@ -439,4 +439,50 @@ public void testExponentialExpressions() {
439439
run.set(false);
440440
assertThat(e.getMessage(), equalTo("grok pattern matching was interrupted after [200] ms"));
441441
}
442+
443+
public void testAtInFieldName() {
444+
assertGrokedField("@metadata");
445+
}
446+
447+
public void assertNonAsciiLetterInFieldName() {
448+
assertGrokedField("metädata");
449+
}
450+
451+
public void assertSquareBracketInFieldName() {
452+
assertGrokedField("metadat[a]");
453+
assertGrokedField("metad[a]ta");
454+
assertGrokedField("[m]etadata");
455+
}
456+
457+
public void testUnderscoreInFieldName() {
458+
assertGrokedField("meta_data");
459+
}
460+
461+
public void testDotInFieldName() {
462+
assertGrokedField("meta.data");
463+
}
464+
465+
public void testMinusInFieldName() {
466+
assertGrokedField("meta-data");
467+
}
468+
469+
public void testAlphanumericFieldName() {
470+
assertGrokedField(randomAlphaOfLengthBetween(1, 5));
471+
assertGrokedField(randomAlphaOfLengthBetween(1, 5) + randomIntBetween(0, 100));
472+
assertGrokedField(randomIntBetween(0, 100) + randomAlphaOfLengthBetween(1, 5));
473+
assertGrokedField(String.valueOf(randomIntBetween(0, 100)));
474+
}
475+
476+
public void testUnsupportedBracketsInFieldName() {
477+
Grok grok = new Grok(basePatterns, "%{WORD:unsuppo(r)ted}");
478+
Map<String, Object> matches = grok.captures("line");
479+
assertNull(matches);
480+
}
481+
482+
private void assertGrokedField(String fieldName) {
483+
String line = "foo";
484+
Grok grok = new Grok(basePatterns, "%{WORD:" + fieldName + "}");
485+
Map<String, Object> matches = grok.captures(line);
486+
assertEquals(line, matches.get(fieldName));
487+
}
442488
}

modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml

+27
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,30 @@ teardown:
238238
repository: repository-file
239239
snapshot: snapshot-one
240240

241+
---
242+
"Get a non existing snapshot":
243+
244+
- do:
245+
catch: /snapshot_missing_exception/
246+
snapshot.get:
247+
repository: repository-url
248+
snapshot: missing
249+
250+
---
251+
"Delete a non existing snapshot":
252+
253+
- do:
254+
catch: /snapshot_missing_exception/
255+
snapshot.delete:
256+
repository: repository-url
257+
snapshot: missing
258+
259+
---
260+
"Restore a non existing snapshot":
261+
262+
- do:
263+
catch: /snapshot_restore_exception/
264+
snapshot.restore:
265+
repository: repository-url
266+
snapshot: missing
267+
wait_for_completion: true

plugins/repository-azure/qa/microsoft-azure-storage/src/test/resources/rest-api-spec/test/repository_azure/10_repository.yml

+66-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Integration tests for repository-azure
22
---
3-
"Snapshot/Restore with repository-azure":
3+
setup:
44

55
# Register repository
66
- do:
@@ -13,7 +13,8 @@
1313
client: "integration_test"
1414
base_path: ${base_path}
1515

16-
- match: { acknowledged: true }
16+
---
17+
"Snapshot/Restore with repository-azure":
1718

1819
# Get repository
1920
- do:
@@ -172,3 +173,66 @@
172173
repository: repository
173174
snapshot: snapshot-one
174175
master_timeout: 5m
176+
177+
---
178+
"Register a repository with a non existing container":
179+
180+
- do:
181+
catch: /repository_verification_exception/
182+
snapshot.create_repository:
183+
repository: repository
184+
body:
185+
type: azure
186+
settings:
187+
container: zHHkfSqlbnBsbpSgvCYtxrEfFLqghXtyPvvvKPNBnRCicNHQLE
188+
client: integration_test
189+
190+
---
191+
"Register a repository with a non existing client":
192+
193+
- do:
194+
# TODO this should be a repository_exception
195+
catch: /settings_exception/
196+
snapshot.create_repository:
197+
repository: repository
198+
body:
199+
type: azure
200+
settings:
201+
bucket: repository
202+
client: unknown
203+
204+
---
205+
"Get a non existing snapshot":
206+
207+
- do:
208+
catch: /snapshot_missing_exception/
209+
snapshot.get:
210+
repository: repository
211+
snapshot: missing
212+
213+
---
214+
"Delete a non existing snapshot":
215+
216+
- do:
217+
catch: /snapshot_missing_exception/
218+
snapshot.delete:
219+
repository: repository
220+
snapshot: missing
221+
222+
---
223+
"Restore a non existing snapshot":
224+
225+
- do:
226+
catch: /snapshot_restore_exception/
227+
snapshot.restore:
228+
repository: repository
229+
snapshot: missing
230+
wait_for_completion: true
231+
232+
---
233+
teardown:
234+
235+
# Remove our repository
236+
- do:
237+
snapshot.delete_repository:
238+
repository: repository

plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepositoryPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class AzureRepositoryPlugin extends Plugin implements RepositoryPlugin, R
4343

4444
public AzureRepositoryPlugin(Settings settings) {
4545
// eagerly load client settings so that secure settings are read
46-
this.azureStoreService = new AzureStorageServiceImpl(settings);
46+
this.azureStoreService = new AzureStorageService(settings);
4747
}
4848

4949
@Override

0 commit comments

Comments
 (0)