Fixes to task result index mapping#50359
Merged
romseygeek merged 1 commit intoelastic:masterfrom Dec 19, 2019
Merged
Conversation
Collaborator
|
Pinging @elastic/es-search (:Search/Mapping) |
Collaborator
|
Pinging @elastic/es-distributed (:Distributed/Task Management) |
Contributor
Author
|
Note that while the bug itself is not released, 7.5 contains the error in the mapping version which means that it will be applying a mapping update on every new task. I'll open a separate bugfix PR to correct this. |
romseygeek
added a commit
that referenced
this pull request
Jan 2, 2020
) We still have a number of places, mainly in test code but some in production, that are building mappings with a named type as the root of a map. CreateIndexRequest handles this automatically, but PutMappingRequest does not, which is a bit trappy - we can get situations like #50359 where the same mapping will work when an index is created but fail on an update. This commit is a first step to removing the leniency in CreateIndexRequest so that we can catch mappings with a named type root earlier. Relates to #41059
SivagurunathanV
pushed a commit
to SivagurunathanV/elasticsearch
that referenced
this pull request
Jan 23, 2020
The built-in mapping for the tasks result index still has a mapping type defined; while this does not matter for index creation, as we still have a create method that takes a top-level type, it does matter for updates. In combination with a separate bug, that the built-in mapping has not incremented its meta version, this meant that tasks submitted to a cluster with an already existing task index would attempt to update the mappings on that index, and fail due to the top-level type. This commit fixes the mapping to have a top-level mapping of _doc, and also updates the meta version so that we do not update mappings on every new task. It also adds a test that explicitly runs two asynchronous tasks to ensure that the mappings do not cause a failure. Fixes elastic#50248
SivagurunathanV
pushed a commit
to SivagurunathanV/elasticsearch
that referenced
this pull request
Jan 23, 2020
…stic#50419) We still have a number of places, mainly in test code but some in production, that are building mappings with a named type as the root of a map. CreateIndexRequest handles this automatically, but PutMappingRequest does not, which is a bit trappy - we can get situations like elastic#50359 where the same mapping will work when an index is created but fail on an update. This commit is a first step to removing the leniency in CreateIndexRequest so that we can catch mappings with a named type root earlier. Relates to elastic#41059
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.
The build-in mapping for the tasks result index still has a mapping type defined; while
this does not matter for index creation, as we still have a create method that takes a
top-level type, it does matter for updates. In combination with a separate bug, that the
built-in mapping has not incremented its meta version, this meant that tasks submitted
to a cluster with an already existing task index would attempt to update the mappings
on that index, and fail due to the top-level type.
This commit fixes the mapping to have a top-level mapping of
_doc, and also updatesthe meta version so that we do not update mappings on every new task. It also adds a
test that explicitly runs two asynchronous tasks to ensure that the mappings do not
cause a failure.
Fixes #50248