Fix assertion error when using passthrough with contradicting fields#110326
Merged
elasticsearchmachine merged 5 commits intoelastic:mainfrom Jul 1, 2024
Merged
Conversation
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
kkrik-es
reviewed
Jul 1, 2024
kkrik-es
approved these changes
Jul 1, 2024
Member
kkrik-es
left a comment
There was a problem hiding this comment.
Thanks for catching and sending a fix promptly.. Tricky logic, the new version is much cleaner.
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
Member
Author
|
The way passthrough field types are created and how the priority is configured has significantly changed in 8.15 with #106829. Backporting this fix to 8.14.x doesn't make sense. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've added a yml rest test that reproduces an assertion error when using the
passthroughfield type with conflicts on multiple levels with a top-levelmatch_only_textfield.When changing the top-level field to a different field type, for example,
keywordortext, the assertion error disappears, but the ordering is not quite right. Note that sometimes the tests pass and sometimes they fail with the following message:Expected a list containing 0: expected "top-level" but was "resource". Seems like in certain cases, the passthrough field type overrides the top-level field. I'm not sure if the two issues are related or separate.This is a dump of the search:
[{ "stash" : { "body" : { "took" : 35, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 1, "relation" : "eq" }, "max_score" : 1.0, "hits" : [ { "_index" : ".ds-otel-2024.07.01-000001", "_id" : "IHWS-EudCPGf0ayGAAABilDXF2o", "_score" : 1.0, "_source" : { "@timestamp" : "2023-09-01T13:03:08.138Z", "attributes" : { "body" : "attribute" }, "body" : "top-level", "metrics" : { "data" : 10 }, "resource" : { "attributes" : { "body" : "resource" } }, "scope" : { "attributes" : { "body" : "scope" } } }, "fields" : { "metrics.data" : [ 10 ], "@timestamp" : [ "2023-09-01T13:03:08.138Z" ], "data" : [ 10 ], "scope.attributes.body" : [ "scope" ], "attributes.body" : [ "attribute" ], "resource.attributes.body" : [ "resource" ], "body" : [ "resource" ] } } ] } } } }]