From f6ace50953ff2eea2825b917daa6cbf803a76466 Mon Sep 17 00:00:00 2001 From: Luigi Dell'Aquila Date: Tue, 10 Sep 2024 19:37:52 +0200 Subject: [PATCH 1/3] EQL: Mute bwc tests that have incompatibilities with Java 23 (#112699) The switch to Java 23 removed support for COMPAT locale provider, so running old versions (< 8.15.2) in a mixed cluster will result in different results for date format (eg. month and day names are truncated to three letters). Fixes https://github.com/elastic/elasticsearch/issues/112617 --- muted-tests.yml | 2 -- x-pack/plugin/eql/qa/rest/build.gradle | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index cf4e519d78a17..1fe7cbb9540b3 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -178,8 +178,6 @@ tests: - class: org.elasticsearch.xpack.ml.integration.MlJobIT method: testPutJob_GivenFarequoteConfig issue: https://github.com/elastic/elasticsearch/issues/112382 -- class: org.elasticsearch.xpack.eql.EqlClientYamlIT - issue: https://github.com/elastic/elasticsearch/issues/112617 - class: org.elasticsearch.xpack.security.authc.kerberos.KerberosTicketValidatorTests method: testWhenKeyTabWithInvalidContentFailsValidation issue: https://github.com/elastic/elasticsearch/issues/112631 diff --git a/x-pack/plugin/eql/qa/rest/build.gradle b/x-pack/plugin/eql/qa/rest/build.gradle index 5f1911dd579bf..d035005758a54 100644 --- a/x-pack/plugin/eql/qa/rest/build.gradle +++ b/x-pack/plugin/eql/qa/rest/build.gradle @@ -30,6 +30,14 @@ tasks.named('yamlRestTestV7CompatTest') { usesDefaultDistribution() } +tasks.named("yamlRestTestV7CompatTransform").configure {task -> + task.skipTest("eql/10_basic/Execute EQL events query with wildcard (*) fields filtering.", "Change of locale with Java 23 makes these tests non deterministic") + task.skipTest("eql/10_basic/Execute EQL sequence with fields filtering.", "Change of locale with Java 23 makes these tests non deterministic") + task.skipTest("eql/10_basic/Execute EQL sequence with custom format for timestamp field.", "Change of locale with Java 23 makes these tests non deterministic") + task.skipTest("eql/10_basic/Execute EQL events query with fields filtering", "Change of locale with Java 23 makes these tests non deterministic") + task.skipTest("eql/10_basic/Execute EQL sequence with wildcard (*) fields filtering.", "Change of locale with Java 23 makes these tests non deterministic") +} + if (BuildParams.inFipsJvm){ // This test cluster is using a BASIC license and FIPS 140 mode is not supported in BASIC tasks.named("javaRestTest").configure{enabled = false } From 48f87c57d9981af15f559c702459022deb2f2b11 Mon Sep 17 00:00:00 2001 From: Oleksandr Kolomiiets Date: Tue, 10 Sep 2024 11:33:27 -0700 Subject: [PATCH 2/3] Fix encoding of dynamic arrays in ignored source (#112713) --- docs/changelog/112713.yaml | 5 +++++ .../elasticsearch/index/mapper/DocumentParser.java | 2 +- .../index/mapper/IgnoredSourceFieldMapperTests.java | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/112713.yaml diff --git a/docs/changelog/112713.yaml b/docs/changelog/112713.yaml new file mode 100644 index 0000000000000..1ccf451b13f82 --- /dev/null +++ b/docs/changelog/112713.yaml @@ -0,0 +1,5 @@ +pr: 112713 +summary: Fix encoding of dynamic arrays in ignored source +area: Logs +type: bug +issues: [] diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java index 150b2b68cc018..bde583fddd914 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java @@ -646,7 +646,7 @@ private static void parseArrayDynamic(DocumentParserContext context, String curr context.addIgnoredField( IgnoredSourceFieldMapper.NameValue.fromContext( context, - currentFieldName, + context.path().pathAsText(currentFieldName), XContentDataHelper.encodeToken(context.parser()) ) ); diff --git a/server/src/test/java/org/elasticsearch/index/mapper/IgnoredSourceFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/IgnoredSourceFieldMapperTests.java index 61c4068cedf4a..a10b47cc06a73 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/IgnoredSourceFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/IgnoredSourceFieldMapperTests.java @@ -221,6 +221,18 @@ public void testMultipleIgnoredFieldsManyObjects() throws IOException { ); } + public void testIgnoredDynamicArrayNestedInObject() throws IOException { + int intValue = randomInt(); + + String syntheticSource = getSyntheticSourceWithFieldLimit(b -> { + b.startObject("bar"); + b.field("a", List.of(intValue, intValue)); + b.endObject(); + }); + assertEquals(String.format(Locale.ROOT, """ + {"bar":{"a":[%s,%s]}}""", intValue, intValue), syntheticSource); + } + public void testDisabledRootObjectSingleField() throws IOException { String name = randomAlphaOfLength(20); DocumentMapper documentMapper = createMapperService(topMapping(b -> { From 69ac8f810e8d519e401ef2ef37e0d87e5a533e99 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Tue, 10 Sep 2024 14:44:33 -0400 Subject: [PATCH 3/3] Fix resolve-dra-manifest.sh --- .ci/scripts/resolve-dra-manifest.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/scripts/resolve-dra-manifest.sh b/.ci/scripts/resolve-dra-manifest.sh index 4ac94122351aa..e42a22834cccb 100755 --- a/.ci/scripts/resolve-dra-manifest.sh +++ b/.ci/scripts/resolve-dra-manifest.sh @@ -30,7 +30,6 @@ if [ "$LATEST_VERSION" != "$ES_VERSION" ]; then fi echo "Using branch $NEW_BRANCH instead of $BRANCH." 1>&2 - echo "https://artifacts-$WORKFLOW.elastic.co/$ARTIFACT/latest/$NEW_BRANCH.json" LATEST_BUILD=$(fetch_build $WORKFLOW $ARTIFACT $NEW_BRANCH) fi