Skip to content

Commit a044ed3

Browse files
Merge branch 'main' into unknown-query-parameter-error-message
2 parents 2fe2dca + 5f9168f commit a044ed3

File tree

98 files changed

+1289
-955
lines changed

Some content is hidden

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

98 files changed

+1289
-955
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/MrjarPlugin.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,19 @@ public void apply(Project project) {
7272
var javaExtension = project.getExtensions().getByType(JavaPluginExtension.class);
7373
var isIdeaSync = System.getProperty("idea.sync.active", "false").equals("true");
7474
var ideaSourceSetsEnabled = project.hasProperty(MRJAR_IDEA_ENABLED) && project.property(MRJAR_IDEA_ENABLED).equals("true");
75+
int minJavaVersion = Integer.parseInt(buildParams.getMinimumCompilerVersion().getMajorVersion());
7576

7677
// Ignore version-specific source sets if we are importing into IntelliJ and have not explicitly enabled this.
7778
// Avoids an IntelliJ bug:
7879
// https://youtrack.jetbrains.com/issue/IDEA-285640/Compiler-Options-Settings-language-level-is-set-incorrectly-with-JDK-19ea
7980
if (isIdeaSync == false || ideaSourceSetsEnabled) {
80-
List<Integer> mainVersions = findSourceVersions(project);
81+
List<Integer> mainVersions = findSourceVersions(project, minJavaVersion);
8182
List<String> mainSourceSets = new ArrayList<>();
8283
mainSourceSets.add(SourceSet.MAIN_SOURCE_SET_NAME);
83-
configurePreviewFeatures(project, javaExtension.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME), 21);
84+
configurePreviewFeatures(project, javaExtension.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME), minJavaVersion);
8485
List<String> testSourceSets = new ArrayList<>(mainSourceSets);
8586
testSourceSets.add(SourceSet.TEST_SOURCE_SET_NAME);
86-
configurePreviewFeatures(project, javaExtension.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME), 21);
87+
configurePreviewFeatures(project, javaExtension.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME), minJavaVersion);
8788
for (int javaVersion : mainVersions) {
8889
String mainSourceSetName = SourceSet.MAIN_SOURCE_SET_NAME + javaVersion;
8990
SourceSet mainSourceSet = addSourceSet(project, javaExtension, mainSourceSetName, mainSourceSets, javaVersion, true);
@@ -103,6 +104,7 @@ public void apply(Project project) {
103104
}
104105

105106
private void configureMrjar(Project project) {
107+
106108
var jarTask = project.getTasks().withType(Jar.class).named(JavaPlugin.JAR_TASK_NAME);
107109
jarTask.configure(task -> { task.manifest(manifest -> { manifest.attributes(Map.of("Multi-Release", "true")); }); });
108110

@@ -222,7 +224,7 @@ private void createTestTask(
222224
project.getTasks().named("check").configure(checkTask -> checkTask.dependsOn(testTaskProvider));
223225
}
224226

225-
private static List<Integer> findSourceVersions(Project project) {
227+
private static List<Integer> findSourceVersions(Project project, int minJavaVersion) {
226228
var srcDir = project.getProjectDir().toPath().resolve("src");
227229
List<Integer> versions = new ArrayList<>();
228230
try (var subdirStream = Files.list(srcDir)) {
@@ -231,7 +233,23 @@ private static List<Integer> findSourceVersions(Project project) {
231233
String sourcesetName = sourceSetPath.getFileName().toString();
232234
Matcher sourcesetMatcher = MRJAR_SOURCESET_PATTERN.matcher(sourcesetName);
233235
if (sourcesetMatcher.matches()) {
234-
versions.add(Integer.parseInt(sourcesetMatcher.group(1)));
236+
int version = Integer.parseInt(sourcesetMatcher.group(1));
237+
if (version < minJavaVersion) {
238+
// NOTE: We allow mainNN for the min java version so that incubating modules can be used without warnings.
239+
// It is a workaround for https://bugs.openjdk.org/browse/JDK-8187591. Once min java is 22, we
240+
// can use the SuppressWarnings("preview") in the code using incubating modules and this check
241+
// can change to <=
242+
throw new IllegalArgumentException(
243+
"Found src dir '"
244+
+ sourcesetName
245+
+ "' for Java "
246+
+ version
247+
+ " but multi-release jar sourceset should have version "
248+
+ minJavaVersion
249+
+ " or greater"
250+
);
251+
}
252+
versions.add(version);
235253
}
236254
}
237255
} catch (IOException e) {

docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
120120
// TODO: remove this once cname is prepended to transport.publish_address by default in 8.0
121121
systemProperty 'es.transport.cname_in_publish_address', 'true'
122122

123+
systemProperty 'es.queryable_built_in_roles_enabled', 'false'
124+
123125
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
124126
requiresFeature 'es.failure_store_feature_flag_enabled', Version.fromString("8.12.0")
125127

docs/changelog/120267.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pr: 120267
2+
summary: Set allow_partial_search_results=true by default
3+
area: EQL
4+
type: breaking
5+
issues: []
6+
breaking:
7+
title: Set allow_partial_search_results=true by default
8+
area: REST API
9+
details:
10+
Before this change, in case of shard failures, EQL queries always returned an error.
11+
With this change, they will keep running and will return partial results.
12+
impact:
13+
EQL queries that would previously fail due to shard failures, will now succeed and return partial results.
14+
The previous defaults can be restored by setting `xpack.eql.default_allow_partial_results` cluster setting to `false`
15+
or setting with `allow_partial_search_results` to `false` in the query request.
16+
notable: false

docs/changelog/120487.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120487
2+
summary: Fix cat_component_templates documentation
3+
area: CAT APIs
4+
type: bug
5+
issues: []

docs/changelog/120799.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120799
2+
summary: Remove duplicate code in ESIntegTestCase
3+
area: Search
4+
type: bug
5+
issues: []

docs/changelog/120809.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 120809
2+
summary: LTR sometines throw `NullPointerException:` Cannot read field "approximation"
3+
because "top" is null
4+
area: Ranking
5+
type: bug
6+
issues: []

docs/reference/eql/eql-search-api.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ If `false`, the request returns an error if one or more shards involved in the q
102102
If `true`, the query is executed only on the available shards, ignoring shard request timeouts and
103103
<<shard-failures,shard failures>>.
104104
+
105-
Defaults to `false`.
105+
Defaults to `true`.
106106
+
107107
To override the default for this field, set the
108-
`xpack.eql.default_allow_partial_results` cluster setting to `true`.
108+
`xpack.eql.default_allow_partial_results` cluster setting to `false`.
109109

110110

111111
[IMPORTANT]

docs/reference/indices/index-templates.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ template with the highest priority is used.
4040
following index patterns:
4141
4242
// tag::built-in-index-template-patterns[]
43+
- `.kibana-reporting*`
4344
- `logs-*-*`
4445
- `metrics-*-*`
4546
- `synthetics-*-*`

docs/reference/indices/put-component-template.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Name of the component template to create.
9797
{es} includes the following built-in component templates:
9898
9999
// tag::built-in-component-templates[]
100+
- `kibana-reporting@settings`
100101
- `logs@mappings`
101102
- `logs@settings`
102103
- `metrics@mappings`

libs/entitlement/bridge/src/main/java/org/elasticsearch/entitlement/bridge/EntitlementChecker.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
import java.nio.channels.SocketChannel;
4343
import java.security.cert.CertStoreParameters;
4444
import java.util.List;
45+
import java.util.Locale;
4546
import java.util.Properties;
47+
import java.util.TimeZone;
4648

4749
import javax.net.ssl.HostnameVerifier;
4850
import javax.net.ssl.HttpsURLConnection;
@@ -188,6 +190,12 @@ public interface EntitlementChecker {
188190

189191
void check$java_util_logging_LogManager$(Class<?> callerClass);
190192

193+
void check$java_util_Locale$$setDefault(Class<?> callerClass, Locale locale);
194+
195+
void check$java_util_Locale$$setDefault(Class<?> callerClass, Locale.Category category, Locale locale);
196+
197+
void check$java_util_TimeZone$$setDefault(Class<?> callerClass, TimeZone zone);
198+
191199
void check$java_net_DatagramSocket$$setDatagramSocketImplFactory(Class<?> callerClass, DatagramSocketImplFactory fac);
192200

193201
void check$java_net_HttpURLConnection$$setFollowRedirects(Class<?> callerClass, boolean set);

0 commit comments

Comments
 (0)