-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Correctly resolve type for delete operations #72809
Conversation
Pinging @elastic/es-search (Team:Search) |
Pinging @elastic/es-distributed (Team:Distributed) |
Marked as I'm not very satisfied with just adding an assert as a test here, but the buggy method doesn't actually contain the relevant information as part of its return type and I am unsure of how to add checks on the method's side effects - if anyone has any clever ideas then let me know. |
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.
LGTM.
I will try to add a test for this. I think it's ok to merge this now to stabilize CI. |
Thanks @dnhatn! |
#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
_doc
canmean 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