Correctly resolve type for delete operations #72809
Merged
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.
#62616 refactored how we deal with building mapping updates for
delete operations against an empty index. In 7x, delete operations
include a type as part of the operation UID, and this type needs to
be resolved against mappings. In particular, the type
_doccanmean either a type called
_doc(the general case), or it can meanwhatever type this index actually has. There are two code pathsin
IndexShard.applyDeleteOperation, one for empty mappingsand one for the standard case; #62616 was resolving the type for
the first code path, but not the second, which meant that some
delete operations could be written to the translog with an incorrect
type.
This commit adds type resolution to the second code path as well.
Fixes #72735