-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Make sure to validate the type before attempting to merge a new mapping. #45157
Merged
Conversation
This file contains 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
jtibshirani
added
>bug
:Search Foundations/Mapping
Index mappings, including merging and defining field types
labels
Aug 2, 2019
Pinging @elastic/es-search |
jtibshirani
changed the title
Make sure to validate the type before parsing a new mapping.
Make sure to validate the type before attempting to merge a new mapping.
Aug 2, 2019
jtibshirani
force-pushed
the
mapping-merge-error
branch
from
August 2, 2019 22:09
4c6c09f
to
e637ea8
Compare
jtibshirani
force-pushed
the
mapping-merge-error
branch
from
August 2, 2019 22:41
e637ea8
to
40f319f
Compare
@elasticmachine run elasticsearch-ci/2 |
mayya-sharipova
approved these changes
Aug 6, 2019
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.
Thanks @jtibshirani, makes sense
Thanks for the review @mayya-sharipova ! |
@elasticmachine run elasticsearch-ci/1 |
jtibshirani
added a commit
that referenced
this pull request
Aug 12, 2019
…ng. (#45157) Currently, when adding a new mapping, we attempt to parse + merge it before checking whether its top-level document type matches the existing type. So when a user attempts to introduce a new mapping type, we may give a confusing error message around merging instead of complaining that it's not possible to add more than one type ("Rejecting mapping update to [my-index] as the final mapping would have more than 1 type..."). This PR moves the type validation to the start of `MetaDataMappingService#applyRequest` so that we make sure the type matches before performing any mapper merging. We already partially addressed this issue in #29316, but the tests there focused on `MapperService` and did not catch this problem with end-to-end mapping updates. Addresses #43012.
jtibshirani
added a commit
that referenced
this pull request
Aug 12, 2019
…ng. (#45157) Currently, when adding a new mapping, we attempt to parse + merge it before checking whether its top-level document type matches the existing type. So when a user attempts to introduce a new mapping type, we may give a confusing error message around merging instead of complaining that it's not possible to add more than one type ("Rejecting mapping update to [my-index] as the final mapping would have more than 1 type..."). This PR moves the type validation to the start of `MetaDataMappingService#applyRequest` so that we make sure the type matches before performing any mapper merging. We already partially addressed this issue in #29316, but the tests there focused on `MapperService` and did not catch this problem with end-to-end mapping updates. Addresses #43012.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Search Foundations/Mapping
Index mappings, including merging and defining field types
v7.3.1
v7.4.0
v8.0.0-alpha1
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.
Currently, when adding a new mapping, we attempt to parse + merge it before
checking whether its top-level document type matches the existing type. So when
a user attempts to introduce a new mapping type, we may give a confusing error
message around merging instead of complaining that it's not possible to add
more than one type ("Rejecting mapping update to [my-index] as the final
mapping would have more than 1 type...").
This PR moves the type validation to the start of
MetaDataMappingService#applyRequest
so that we make sure the type matchesbefore performing any mapper merging.
We already partially addressed this issue in #29316, but the tests there
focused on
MapperService
and did not catch this problem with end-to-endmapping updates.
Addresses #43012.