Skip to content

Commit c7ce83e

Browse files
committed
Merge branch 'main' into feature/esql-match-options
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java
2 parents b7fb9d0 + 9ffe3c8 commit c7ce83e

File tree

63 files changed

+1405
-934
lines changed

Some content is hidden

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

63 files changed

+1405
-934
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/script/ScriptScoreBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class ScriptScoreBenchmark {
7878
private final PluginsService pluginsService = new PluginsService(
7979
Settings.EMPTY,
8080
null,
81-
PluginsLoader.createPluginsLoader(Set.of(), PluginsLoader.loadPluginsBundles(Path.of(System.getProperty("plugins.dir"))))
81+
PluginsLoader.createPluginsLoader(Set.of(), PluginsLoader.loadPluginsBundles(Path.of(System.getProperty("plugins.dir"))), Map.of())
8282
);
8383
private final ScriptModule scriptModule = new ScriptModule(Settings.EMPTY, pluginsService.filterPlugins(ScriptPlugin.class).toList());
8484

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/SystemJvmOptions.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.io.IOException;
1919
import java.nio.file.Files;
2020
import java.nio.file.Path;
21+
import java.util.ArrayList;
2122
import java.util.List;
2223
import java.util.Map;
2324
import java.util.stream.Stream;
@@ -69,7 +70,7 @@ static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, St
6970
// Pass through distribution type
7071
"-Des.distribution.type=" + distroType
7172
),
72-
maybeEnableNativeAccess(),
73+
maybeEnableNativeAccess(useEntitlements),
7374
maybeOverrideDockerCgroup(distroType),
7475
maybeSetActiveProcessorCount(nodeSettings),
7576
maybeSetReplayFile(distroType, isHotspot),
@@ -124,11 +125,18 @@ private static Stream<String> maybeSetActiveProcessorCount(Settings nodeSettings
124125
return Stream.empty();
125126
}
126127

127-
private static Stream<String> maybeEnableNativeAccess() {
128+
private static Stream<String> maybeEnableNativeAccess(boolean useEntitlements) {
129+
var enableNativeAccessOptions = new ArrayList<String>();
128130
if (Runtime.version().feature() >= 21) {
129-
return Stream.of("--enable-native-access=org.elasticsearch.nativeaccess,org.apache.lucene.core");
131+
enableNativeAccessOptions.add("--enable-native-access=org.elasticsearch.nativeaccess,org.apache.lucene.core");
132+
if (useEntitlements) {
133+
enableNativeAccessOptions.add("--enable-native-access=ALL-UNNAMED");
134+
if (Runtime.version().feature() >= 24) {
135+
enableNativeAccessOptions.add("--illegal-native-access=deny");
136+
}
137+
}
130138
}
131-
return Stream.empty();
139+
return enableNativeAccessOptions.stream();
132140
}
133141

134142
/*

docs/changelog/119072.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pr: 119072
2+
summary: Turn `_source` meta fieldmapper's mode attribute into a no-op
3+
area: Mapping
4+
type: breaking
5+
issues:
6+
- 118596
7+
breaking:
8+
title: Turn `_source` meta fieldmapper's mode attribute into a no-op
9+
area: Mapping
10+
details: The `mode` mapping attribute of `_source` metadata field mapper has been turned into a no-op. Instead the `index.mapping.source.mode` index setting should be used to configure source mode.
11+
impact: Configuring the `mode` attribute for the `_source` meta field mapper will have no effect on indices created with Elasticsearch 9.0.0 or later. Note that `_source.mode` configured on indices before upgrading to 9.0.0 or later will remain efficive after upgrading.
12+
notable: false

docs/changelog/120494.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120494
2+
summary: Update grammar to rely on `indexPattern` instead of identifier in join target
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,6 @@ public void checkChangeNetworkHandling(Class<?> callerClass) {
182182
checkChangeJVMGlobalState(callerClass);
183183
}
184184

185-
/**
186-
* Check for operations that can access sensitive network information, e.g. secrets, tokens or SSL sessions
187-
*/
188-
public void checkReadSensitiveNetworkInformation(Class<?> callerClass) {
189-
neverEntitled(callerClass, "access sensitive network information");
190-
}
191-
192185
/**
193186
* Check for operations that can access sensitive network information, e.g. secrets, tokens or SSL sessions
194187
*/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.nativeaccess;
11+
12+
public class NativeAccessUtil {
13+
/**
14+
* Enables native access for the provided module. No-op for JDK 21 or before.
15+
*/
16+
public static void enableNativeAccess(ModuleLayer.Controller controller, Module module) {}
17+
18+
public static boolean isNativeAccessEnabled(Module module) {
19+
return true;
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.nativeaccess;
11+
12+
public class NativeAccessUtil {
13+
/**
14+
* Enables native access for the provided module. Available to JDK 22+, required for JDK 24+ when using --illegal-native-access=deny
15+
*/
16+
public static void enableNativeAccess(ModuleLayer.Controller controller, Module module) {
17+
controller.enableNativeAccess(module);
18+
}
19+
20+
public static boolean isNativeAccessEnabled(Module module) {
21+
return module.isNativeAccessEnabled();
22+
}
23+
}

muted-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ tests:
241241
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
242242
method: testStopQuery
243243
issue: https://github.com/elastic/elasticsearch/issues/120767
244+
- class: org.elasticsearch.search.fieldcaps.FieldCapabilitiesIT
245+
issue: https://github.com/elastic/elasticsearch/issues/120772
246+
- class: org.elasticsearch.action.search.SearchProgressActionListenerIT
247+
method: testSearchProgressWithHits
248+
issue: https://github.com/elastic/elasticsearch/issues/120671
244249

245250
# Examples:
246251
#
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.upgrades;
11+
12+
import com.carrotsearch.randomizedtesting.annotations.Name;
13+
14+
import org.elasticsearch.client.Request;
15+
import org.elasticsearch.index.mapper.SourceFieldMapper;
16+
17+
import java.io.IOException;
18+
import java.util.List;
19+
import java.util.Map;
20+
21+
import static org.hamcrest.Matchers.containsString;
22+
import static org.hamcrest.Matchers.equalTo;
23+
24+
public class SourceModeRollingUpgradeIT extends AbstractRollingUpgradeTestCase {
25+
26+
public SourceModeRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
27+
super(upgradedNodes);
28+
}
29+
30+
public void testConfigureStoredSourceBeforeIndexCreationLegacy() throws IOException {
31+
assumeTrue("testing deprecation warnings and deprecation migrations", getOldClusterTestVersion().before("9.0.0"));
32+
String templateName = "logs@custom";
33+
if (isOldCluster()) {
34+
var storedSourceMapping = """
35+
{
36+
"template": {
37+
"settings": {
38+
"index": {
39+
"mode": "logsdb"
40+
}
41+
},
42+
"mappings": {
43+
"_source": {
44+
"mode": "stored"
45+
}
46+
}
47+
}
48+
}""";
49+
var putComponentTemplateRequest = new Request("PUT", "/_component_template/" + templateName);
50+
putComponentTemplateRequest.setOptions(expectWarnings(SourceFieldMapper.DEPRECATION_WARNING));
51+
putComponentTemplateRequest.setJsonEntity(storedSourceMapping);
52+
assertOK(client().performRequest(putComponentTemplateRequest));
53+
54+
var request = new Request("GET", "/_migration/deprecations");
55+
var nodeSettings = (Map<?, ?>) ((List<?>) entityAsMap(client().performRequest(request)).get("node_settings")).getFirst();
56+
assertThat(nodeSettings.get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
57+
assertThat(
58+
(String) nodeSettings.get("details"),
59+
containsString(SourceFieldMapper.DEPRECATION_WARNING + " Affected component templates: [" + templateName + "]")
60+
);
61+
} else if (isUpgradedCluster()) {
62+
var request = new Request("GET", "/_migration/deprecations");
63+
var nodeSettings = (Map<?, ?>) ((List<?>) entityAsMap(client().performRequest(request)).get("node_settings")).getFirst();
64+
assertThat(nodeSettings.get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
65+
assertThat(
66+
(String) nodeSettings.get("details"),
67+
containsString(SourceFieldMapper.DEPRECATION_WARNING + " Affected component templates: [" + templateName + "]")
68+
);
69+
}
70+
}
71+
72+
public void testConfigureStoredSourceWhenIndexIsCreatedLegacy() throws IOException {
73+
assumeTrue("testing deprecation warnings and deprecation migrations", getOldClusterTestVersion().before("9.0.0"));
74+
String templateName = "logs@custom";
75+
if (isOldCluster()) {
76+
var storedSourceMapping = """
77+
{
78+
"template": {
79+
"mappings": {
80+
"_source": {
81+
"mode": "stored"
82+
}
83+
}
84+
}
85+
}""";
86+
var putComponentTemplateRequest = new Request("PUT", "/_component_template/" + templateName);
87+
putComponentTemplateRequest.setOptions(expectWarnings(SourceFieldMapper.DEPRECATION_WARNING));
88+
putComponentTemplateRequest.setJsonEntity(storedSourceMapping);
89+
assertOK(client().performRequest(putComponentTemplateRequest));
90+
91+
var request = new Request("GET", "/_migration/deprecations");
92+
var nodeSettings = (Map<?, ?>) ((List<?>) entityAsMap(client().performRequest(request)).get("node_settings")).getFirst();
93+
assertThat(nodeSettings.get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
94+
assertThat(
95+
(String) nodeSettings.get("details"),
96+
containsString(SourceFieldMapper.DEPRECATION_WARNING + " Affected component templates: [" + templateName + "]")
97+
);
98+
} else if (isUpgradedCluster()) {
99+
var request = new Request("GET", "/_migration/deprecations");
100+
var nodeSettings = (Map<?, ?>) ((List<?>) entityAsMap(client().performRequest(request)).get("node_settings")).getFirst();
101+
assertThat(nodeSettings.get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
102+
assertThat(
103+
(String) nodeSettings.get("details"),
104+
containsString(SourceFieldMapper.DEPRECATION_WARNING + " Affected component templates: [" + templateName + "]")
105+
);
106+
}
107+
}
108+
}

rest-api-spec/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,15 @@ tasks.named("yamlRestCompatTestTransform").configure ({ task ->
8787
task.skipTest("search.highlight/30_max_analyzed_offset/Plain highlighter with max_analyzed_offset < 0 should FAIL", "semantics of test has changed")
8888
task.skipTest("indices.create/10_basic/Create lookup index", "default auto_expand_replicas was removed")
8989
task.skipTest("indices.create/10_basic/Create lookup index with one shard", "default auto_expand_replicas was removed")
90+
task.skipTest("range/20_synthetic_source/Double range", "_source.mode mapping attribute is no-op since 9.0.0")
91+
task.skipTest("range/20_synthetic_source/Float range", "_source.mode mapping attribute is no-op since 9.0.0")
92+
task.skipTest("range/20_synthetic_source/Integer range", "_source.mode mapping attribute is no-op since 9.0.0")
93+
task.skipTest("range/20_synthetic_source/IP range", "_source.mode mapping attribute is no-op since 9.0.0")
94+
task.skipTest("range/20_synthetic_source/Long range", "_source.mode mapping attribute is no-op since 9.0.0")
95+
task.skipTest("range/20_synthetic_source/Date range Rounding Fixes", "_source.mode mapping attribute is no-op since 9.0.0")
96+
task.skipTest("index/92_metrics_auto_subobjects/Metrics object indexing with synthetic source", "_source.mode mapping attribute is no-op since 9.0.0")
97+
task.skipTest("index/92_metrics_auto_subobjects/Root without subobjects with synthetic source", "_source.mode mapping attribute is no-op since 9.0.0")
98+
task.skipTest("index/91_metrics_no_subobjects/Metrics object indexing with synthetic source", "_source.mode mapping attribute is no-op since 9.0.0")
99+
task.skipTest("index/91_metrics_no_subobjects/Root without subobjects with synthetic source", "_source.mode mapping attribute is no-op since 9.0.0")
100+
task.skipTest("logsdb/10_settings/routing path allowed in logs mode with routing on sort fields", "Unknown feature routing.logsb_route_on_sort_fields")
90101
})

0 commit comments

Comments
 (0)