Deleted docs disregarded for if_seq_no check#50526
Merged
henningandersen merged 3 commits intoelastic:masterfrom Jan 6, 2020
Merged
Deleted docs disregarded for if_seq_no check#50526henningandersen merged 3 commits intoelastic:masterfrom
henningandersen merged 3 commits intoelastic:masterfrom
Conversation
Previously, as long as a deleted version value was kept as a tombstone, another index or delete operation against the same id would leak that the doc had existed (through seq_no info) or would allow the operation if the client forged the seq_no (which in principle could be a dirty read). Fixed to disregard info on deleted docs when doing optimistic concurrency check.
Collaborator
|
Pinging @elastic/es-distributed (:Distributed/Engine) |
UpdateSettingsIT used seq_no to validate index.gc_deletes. This is no longer possible (with this PR) and we instead use external versioning, which seems to be the only valid use case for triggering on tombstones. SimpleVersioningIT was fixed since a conditional delete against a deleted doc now fails.
dnhatn
approved these changes
Jan 2, 2020
Member
dnhatn
left a comment
There was a problem hiding this comment.
LGTM. The fix makes sense to me. Thanks Henning. How did you find this issue (just curious)?
Contributor
Author
|
Thanks for reviewing @dnhatn
I was helping debugging a REST test where a conditional index operation failed with a message saying that the current seq-no was different from the if-seq-no. This led us down a path of investigating why the doc was updated, but it turned out it was indeed deleted. I opened this PR primarily to avoid that confusion. |
henningandersen
added a commit
that referenced
this pull request
Jan 6, 2020
Previously, as long as a deleted version value was kept as a tombstone, another index or delete operation against the same id would leak that the doc had existed (through seq_no info) or would allow the operation if the client forged the seq_no. Fixed to disregard info on deleted docs when doing seq_no based optimistic concurrency check.
Contributor
Author
|
Thanks for the reviews, Nhat and Yannick. |
SivagurunathanV
pushed a commit
to SivagurunathanV/elasticsearch
that referenced
this pull request
Jan 23, 2020
Previously, as long as a deleted version value was kept as a tombstone, another index or delete operation against the same id would leak that the doc had existed (through seq_no info) or would allow the operation if the client forged the seq_no. Fixed to disregard info on deleted docs when doing seq_no based optimistic concurrency check.
This was referenced Feb 3, 2020
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.
Previously, as long as a deleted version value was kept as a tombstone,
another index or delete operation against the same id would leak that
the doc had existed (through seq_no info) or would allow the operation
if the client forged the seq_no. Fixed to disregard info on deleted docs
when doing seq_no based optimistic concurrency check.
AFAICS the use of the tombstones/gc_deletes period is only relevant to
external versioning.