-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate root subobjects setting to downsample indexes #115358
Conversation
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
private static void addRootSubobjects(Map<String, Object> sourceIndexMappings, XContentBuilder builder) throws IOException { | ||
if (sourceIndexMappings.containsKey("subobjects")) { | ||
builder.field("subobjects", sourceIndexMappings.get("subobjects")); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on the fence for this one, it should be safe but we're updating production logic to make tests happy.. I can add tests if we like it, or guard behind a flag to use in tests only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok...anyway if you look a bit below we use a MappingVisitor
object to visit mappings...maybe that is a better way to go through mappings and apply changes. Indeed I wonder if we need to do this for nested subobjects
properties too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, though I was thinking of going to the other direction and skipping objects entirely. Today, we don't propagate any object properties so subobjects:false
should always be applicable..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or guard behind a flag to use in tests only.
I think that this should be behind a setting and use it only for tests now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one comment, LGTM otherwise.
private static void addRootSubobjects(Map<String, Object> sourceIndexMappings, XContentBuilder builder) throws IOException { | ||
if (sourceIndexMappings.containsKey("subobjects")) { | ||
builder.field("subobjects", sourceIndexMappings.get("subobjects")); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or guard behind a flag to use in tests only.
I think that this should be behind a setting and use it only for tests now.
Turns out the downsampling changes are not needed. I reverted them and both tests pass. |
💔 Backport failedThe backport operation could not be completed due to the following error:
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* Propagate root subobjects setting to downsample indexes * exclude tests from rest compat * remove subobjects propagation (cherry picked from commit 5c1a3ad)
* Propagate root subobjects setting to downsample indexes * exclude tests from rest compat * remove subobjects propagation
* Propagate root subobjects setting to downsample indexes * exclude tests from rest compat * remove subobjects propagation
Setting this in downsample tests allows running them with both trial and basic license.