Skip to content

Commit 2f3597b

Browse files
authored
Merge branch 'main' into search_load_per_index_multiproject
2 parents 7cfec46 + 46e5f1c commit 2f3597b

File tree

12 files changed

+81
-57
lines changed

12 files changed

+81
-57
lines changed

muted-tests.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -489,36 +489,6 @@ tests:
489489
- class: org.elasticsearch.packaging.test.DockerTests
490490
method: test085EnvironmentVariablesAreRespectedUnderDockerExec
491491
issue: https://github.com/elastic/elasticsearch/issues/128115
492-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.RLikeTests
493-
method: testEvaluateInManyThreads {TestCase=100 random code points matches self case insensitive with text}
494-
issue: https://github.com/elastic/elasticsearch/issues/128705
495-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.RLikeTests
496-
method: testEvaluateInManyThreads {TestCase=100 random code points matches self case insensitive with keyword}
497-
issue: https://github.com/elastic/elasticsearch/issues/128706
498-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.RLikeTests
499-
method: testCrankyEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with text}
500-
issue: https://github.com/elastic/elasticsearch/issues/128710
501-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.RLikeTests
502-
method: testCrankyEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with keyword}
503-
issue: https://github.com/elastic/elasticsearch/issues/128711
504-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.WildcardLikeTests
505-
method: testCrankyEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with text}
506-
issue: https://github.com/elastic/elasticsearch/issues/128712
507-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.WildcardLikeTests
508-
method: testCrankyEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with keyword}
509-
issue: https://github.com/elastic/elasticsearch/issues/128713
510-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.WildcardLikeTests
511-
method: testEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with text}
512-
issue: https://github.com/elastic/elasticsearch/issues/128714
513-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.WildcardLikeTests
514-
method: testEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with keyword}
515-
issue: https://github.com/elastic/elasticsearch/issues/128715
516-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.RLikeTests
517-
method: testEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with keyword}
518-
issue: https://github.com/elastic/elasticsearch/issues/128716
519-
- class: org.elasticsearch.xpack.esql.expression.function.scalar.string.RLikeTests
520-
method: testEvaluateBlockWithNulls {TestCase=100 random code points matches self case insensitive with text}
521-
issue: https://github.com/elastic/elasticsearch/issues/128717
522492
- class: org.elasticsearch.compute.operator.LimitOperatorTests
523493
method: testEarlyTermination
524494
issue: https://github.com/elastic/elasticsearch/issues/128721

plugins/repository-hdfs/build.gradle

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,36 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
10+
1111
import org.elasticsearch.gradle.OS
12+
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
1213

1314
apply plugin: 'elasticsearch.internal-java-rest-test'
1415
apply plugin: 'elasticsearch.internal-yaml-rest-test'
1516

1617
esplugin {
1718
description = 'The HDFS repository plugin adds support for Hadoop Distributed File-System (HDFS) repositories.'
18-
classname ='org.elasticsearch.repositories.hdfs.HdfsPlugin'
19+
classname = 'org.elasticsearch.repositories.hdfs.HdfsPlugin'
1920
}
2021

2122
versions << [
2223
'hadoop': '3.4.1'
2324
]
2425

2526
def patched = Attribute.of('patched', Boolean)
27+
def hdfsVersionAttr = Attribute.of('hdfs.major.version', Integer)
2628

2729
configurations {
28-
hdfsFixture2
29-
hdfsFixture3
30+
hdfsFixture2 {
31+
attributes {
32+
attribute(hdfsVersionAttr, 2)
33+
}
34+
}
35+
hdfsFixture3 {
36+
attributes {
37+
attribute(hdfsVersionAttr, 3)
38+
}
39+
}
3040
compileClasspath {
3141
attributes {
3242
attribute(patched, true)
@@ -82,8 +92,8 @@ dependencies {
8292
yamlRestTestRuntimeOnly "commons-cli:commons-cli:1.5.0"
8393
yamlRestTestRuntimeOnly "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
8494

85-
hdfsFixture2 project(path: ':test:fixtures:hdfs-fixture', configuration: 'shadowedHdfs2')
86-
hdfsFixture3 project(path: ':test:fixtures:hdfs-fixture', configuration: 'shadow')
95+
hdfsFixture2 project(':test:fixtures:hdfs-fixture')
96+
hdfsFixture3 project(':test:fixtures:hdfs-fixture')
8797

8898
attributesSchema {
8999
attribute(patched)

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ static TransportVersion def(int id) {
187187
public static final TransportVersion INFERENCE_CUSTOM_SERVICE_ADDED_8_19 = def(8_841_0_39);
188188
public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ADDED_8_19 = def(8_841_0_40);
189189
public static final TransportVersion DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19 = def(8_841_0_41);
190+
public static final TransportVersion JOIN_ON_ALIASES_8_19 = def(8_841_0_42);
190191
public static final TransportVersion V_9_0_0 = def(9_000_0_09);
191192
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
192193
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);

server/src/main/java/org/elasticsearch/action/search/OnlinePrewarmingServiceProvider.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@
1111

1212
import org.elasticsearch.cluster.service.ClusterService;
1313
import org.elasticsearch.common.settings.Settings;
14+
import org.elasticsearch.telemetry.TelemetryProvider;
1415
import org.elasticsearch.threadpool.ThreadPool;
1516

1617
public interface OnlinePrewarmingServiceProvider {
17-
OnlinePrewarmingServiceProvider DEFAULT = (settings, threadPool, clusterService) -> OnlinePrewarmingService.NOOP;
18+
OnlinePrewarmingServiceProvider DEFAULT = (settings, threadPool, clusterService, telemetryProvider) -> OnlinePrewarmingService.NOOP;
1819

19-
OnlinePrewarmingService create(Settings settings, ThreadPool threadPool, ClusterService clusterService);
20+
OnlinePrewarmingService create(
21+
Settings settings,
22+
ThreadPool threadPool,
23+
ClusterService clusterService,
24+
TelemetryProvider telemetryProvider
25+
);
2026
}

server/src/main/java/org/elasticsearch/cluster/NodeConnectionsService.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,7 @@ void disconnect() {
342342

343343
@Override
344344
public String toString() {
345-
synchronized (mutex) {
346-
return "ConnectionTarget{" + "discoveryNode=" + discoveryNode + '}';
347-
}
345+
return "ConnectionTarget{discoveryNode=" + discoveryNode + '}';
348346
}
349347
}
350348
}

server/src/main/java/org/elasticsearch/node/NodeConstruction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ public Map<String, String> queryFields() {
11731173
OnlinePrewarmingService onlinePrewarmingService = pluginsService.loadSingletonServiceProvider(
11741174
OnlinePrewarmingServiceProvider.class,
11751175
() -> OnlinePrewarmingServiceProvider.DEFAULT
1176-
).create(clusterService.getSettings(), threadPool, clusterService);
1176+
).create(clusterService.getSettings(), threadPool, clusterService, telemetryProvider);
11771177
final SearchService searchService = serviceProvider.newSearchService(
11781178
pluginsService,
11791179
clusterService,

test/fixtures/hdfs-fixture/build.gradle

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
1515

1616
def hdfs2patched = Attribute.of('hdfs2-patched', Boolean)
1717
def hdfs3patched = Attribute.of('hdfs3-patched', Boolean)
18+
def hdfsVersionAttr = Attribute.of('hdfs.major.version', Integer)
19+
1820
configurations {
1921
hdfs2 {
2022
attributes {
@@ -26,7 +28,26 @@ configurations {
2628
attribute(hdfs3patched, true)
2729
}
2830
}
29-
consumable("shadowedHdfs2")
31+
consumable("shadowedHdfs2") {
32+
attributes {
33+
attribute(hdfsVersionAttr, 2)
34+
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.LIBRARY))
35+
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME))
36+
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, Integer.parseInt(buildParams.minimumRuntimeVersion.getMajorVersion()))
37+
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR))
38+
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.EXTERNAL))
39+
}
40+
}
41+
consumable("shadowedHdfs3") {
42+
attributes {
43+
attribute(hdfsVersionAttr, 3)
44+
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.LIBRARY))
45+
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME))
46+
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, Integer.parseInt(buildParams.minimumRuntimeVersion.getMajorVersion()))
47+
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR))
48+
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.EXTERNAL))
49+
}
50+
}
3051
}
3152

3253
dependencies {
@@ -165,4 +186,5 @@ tasks.withType(ShadowJar).configureEach {
165186

166187
artifacts {
167188
shadowedHdfs2(hdfs2Jar)
189+
shadowedHdfs3(tasks.named("shadowJar"))
168190
}

test/fixtures/krb5kdc-fixture/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ configurations {
2525
all {
2626
exclude group: 'org.hamcrest', module: 'hamcrest-core'
2727
}
28-
krb5ConfHdfsFile {
29-
canBeConsumed = true
30-
canBeResolved = false
31-
}
32-
krb5KeytabsHdfsDir {
33-
canBeConsumed = true
34-
canBeResolved = false
35-
}
3628
}
3729

3830
dependencies {

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ static TransportRequest readFrom(StreamInput in, BlockFactory blockFactory) thro
153153
ShardId shardId = new ShardId(in);
154154

155155
String indexPattern;
156-
if (in.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES)) {
156+
if (in.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES)
157+
|| in.getTransportVersion().isPatchFrom(TransportVersions.JOIN_ON_ALIASES_8_19)) {
157158
indexPattern = in.readString();
158159
} else {
159160
indexPattern = shardId.getIndexName();
@@ -198,7 +199,8 @@ public void writeTo(StreamOutput out) throws IOException {
198199
out.writeString(sessionId);
199200
out.writeWriteable(shardId);
200201

201-
if (out.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES)) {
202+
if (out.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES)
203+
|| out.getTransportVersion().isPatchFrom(TransportVersions.JOIN_ON_ALIASES_8_19)) {
202204
out.writeString(indexPattern);
203205
} else if (indexPattern.equals(shardId.getIndexName()) == false) {
204206
throw new EsqlIllegalArgumentException("Aliases and index patterns are not allowed for LOOKUP JOIN []", indexPattern);

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RLikeTests.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,15 @@ private static void casesForString(
9494
return new TextAndPattern(text, escapeString.apply(text));
9595
}, true);
9696
cases(cases, title + " matches self case insensitive", () -> {
97-
String text = textSupplier.get();
98-
return new TextAndPattern(randomCasing(text), escapeString.apply(text));
97+
// RegExp doesn't support case-insensitive matching for Unicodes whose length changes when the case changes.
98+
// Example: a case-insensitive ES regexp query for the pattern `weiß` won't match the value `WEISS` (but will match `WEIß`).
99+
// Or `ʼn` (U+0149) vs. `ʼN` (U+02BC U+004E).
100+
String text, caseChanged;
101+
for (text = textSupplier.get(), caseChanged = randomCasing(text); text.length() != caseChanged.length();) {
102+
text = textSupplier.get();
103+
caseChanged = randomCasing(text);
104+
}
105+
return new TextAndPattern(caseChanged, escapeString.apply(text));
99106
}, true, true);
100107
cases(cases, title + " doesn't match self with trailing", () -> {
101108
String text = textSupplier.get();

0 commit comments

Comments
 (0)