-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Dynamic mapping updates do not call fixRedundantIncludes
#74899
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
Comments
Pinging @elastic/es-search (Team:Search) |
We've talked in the past about making this validation step part of the creation of a new DocumentMapper. I was surprised that it is called only in some cases and I believe I left as-is, unless I introduced bugs while touching that area of the code. It sounds like it should be made part of creating a new mapping regardless of how it is created. |
From my notes:
|
Yeah I think this will be fixed by #74410 which makes it part of the build/merge logic for NestedObjectMapper itself but I'll do a separate fix for 7.14/7.13.4 anyway and we can re-use the tests. |
Dynamic mappings updates containing nested mappings were not fixing their redundant include settings before being posted back to the put mappings service; this meant that a dynamic mapping that had both 'include_in_parent' and 'include_in_root' set to 'true' could cause an error if it was returned from multiple shards, because the first mapping would be updated to have 'include_in_root' set to 'false' when merged, and merging this with the second mapping with 'include_in_root' set to 'true' would cause a conflict. This commit ensures that fixRedundantIncludes is called on dynamic mappings before they are posted back to the mapping service. Fixes #74899
Dynamic mappings updates containing nested mappings were not fixing their redundant include settings before being posted back to the put mappings service; this meant that a dynamic mapping that had both 'include_in_parent' and 'include_in_root' set to 'true' could cause an error if it was returned from multiple shards, because the first mapping would be updated to have 'include_in_root' set to 'false' when merged, and merging this with the second mapping with 'include_in_root' set to 'true' would cause a conflict. This commit ensures that fixRedundantIncludes is called on dynamic mappings before they are posted back to the mapping service. Fixes elastic#74899
Dynamic mappings updates containing nested mappings were not fixing their redundant include settings before being posted back to the put mappings service; this meant that a dynamic mapping that had both 'include_in_parent' and 'include_in_root' set to 'true' could cause an error if it was returned from multiple shards, because the first mapping would be updated to have 'include_in_root' set to 'false' when merged, and merging this with the second mapping with 'include_in_root' set to 'true' would cause a conflict. This commit ensures that fixRedundantIncludes is called on dynamic mappings before they are posted back to the mapping service. Fixes elastic#74899
…74918) Dynamic mappings updates containing nested mappings were not fixing their redundant include settings before being posted back to the put mappings service; this meant that a dynamic mapping that had both 'include_in_parent' and 'include_in_root' set to 'true' could cause an error if it was returned from multiple shards, because the first mapping would be updated to have 'include_in_root' set to 'false' when merged, and merging this with the second mapping with 'include_in_root' set to 'true' would cause a conflict. This commit ensures that fixRedundantIncludes is called on dynamic mappings before they are posted back to the mapping service. Fixes #74899
…74918) Dynamic mappings updates containing nested mappings were not fixing their redundant include settings before being posted back to the put mappings service; this meant that a dynamic mapping that had both 'include_in_parent' and 'include_in_root' set to 'true' could cause an error if it was returned from multiple shards, because the first mapping would be updated to have 'include_in_root' set to 'false' when merged, and merging this with the second mapping with 'include_in_root' set to 'true' would cause a conflict. This commit ensures that fixRedundantIncludes is called on dynamic mappings before they are posted back to the mapping service. Fixes #74899
…74917) Dynamic mappings updates containing nested mappings were not fixing their redundant include settings before being posted back to the put mappings service; this meant that a dynamic mapping that had both 'include_in_parent' and 'include_in_root' set to 'true' could cause an error if it was returned from multiple shards, because the first mapping would be updated to have 'include_in_root' set to 'false' when merged, and merging this with the second mapping with 'include_in_root' set to 'true' would cause a conflict. This commit ensures that fixRedundantIncludes is called on dynamic mappings before they are posted back to the mapping service. Fixes #74899
RootObjectMapper has a method
fixRedundantIncludes
which will iteratethrough its object hierarchy and find nested mappers that have
include_in_root
set where they don't need it. However, this method is not called when a dynamic
mapping is built. This means that a bulk index request that creates a nested mapper
through a dynamic mapping update can end up throwing errors: the dynamic
mapping contains a nested object with both 'include_in_parent' and 'include_in_root'
set to true; this mapping is applied on the master and `include_in_root' is adjusted
to 'false' because it is redundant; the same dynamic mapping on a different shard
is sent to the master; and this mapping will fail because merging is done before
redundant includes are fixed, and so there is a conflict.
The text was updated successfully, but these errors were encountered: