[
https://issues.apache.org/jira/browse/CASSANDRA-5062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13591568#comment-13591568
]
Cristian Opris commented on CASSANDRA-5062:
-------------------------------------------
[~luiscarneiro] What may happen with this is you read a value from the most
advanced replica and then you try a CAS at a stale replica which will deny it
even if it's legit, because it does not match its stale value.
I think something like this may work where you track a version counter for each
row and you make sure you advance paxos rounds (and version counter) one at a
time per quorum.
Basically the invariant is that a replica initiates or participates in paxos
round V only after
it has committed V-1 locally, which can happen when:
- it learns a *majority* has *accepted* a value at V-1 so it can *commit* V-1
locally (i.e. paxos round V-1 is settled)
- it learns that *any* replica has *committed* V-1
I am still fuzzy how this can be accomplished exactly but the invariants seem
good.
> Support CAS
> -----------
>
> Key: CASSANDRA-5062
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5062
> Project: Cassandra
> Issue Type: New Feature
> Components: API, Core
> Reporter: Jonathan Ellis
> Fix For: 2.0
>
> Attachments: half-baked commit 1.jpg, half-baked commit 2.jpg,
> half-baked commit 3.jpg
>
>
> "Strong" consistency is not enough to prevent race conditions. The classic
> example is user account creation: we want to ensure usernames are unique, so
> we only want to signal account creation success if nobody else has created
> the account yet. But naive read-then-write allows clients to race and both
> think they have a green light to create.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira