-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Use sequences numbers for Compare and Set operations #26493
Labels
:Distributed Indexing/Engine
Anything around managing Lucene and the Translog in an open shard.
high hanging fruit
Comments
Hi @jasontedor, I am thinking to work on this. What do you think? Thank you. |
@dnhatn I think we can get there, but let’s work our ways towards it. |
Just registering my interest in this too @dnhatn. Please ping me if you're discussing this. |
@DaveCTurner Sure. |
Let’s return to this one in the future after we have addressed some other issues first. |
dnhatn
added a commit
to dnhatn/elasticsearch
that referenced
this issue
Oct 30, 2017
Currently, we are using _version for CAS operations. However, using _version alone does not guarantee the uniqueness during a network partition. To remedy the issue, we recommend using a combination of _version and _primary_term for CAS operations. This is the first step towards that goal. In this change, we return _primary_term for GET and MGET requests. Relates elastic#26493
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Distributed Indexing/Engine
Anything around managing Lucene and the Translog in an open shard.
high hanging fruit
Elasticsearch currently supports CAS operations (needed for optimistic concurrency) using a document
_version
field. Sadly this is not water tight and can go wrong if a primary fails between the read and the CAS write operation. To remedy this we need to move to using a document's_seq_no
and_primary_term
fields as an identifier for CAS operations.To do so we will add two parameters to write operations -
_expected_seq_no
and_expected_primary_term
. When set, those parameters will require the document to have exactly the expected values in the respective fields for a successful write.Note that this can co-exists with the the current
_version
based method, which we can phase out or make optional later on.Relates #10708
The text was updated successfully, but these errors were encountered: