[ 
https://issues.apache.org/jira/browse/CASSANDRA-5062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13593273#comment-13593273
 ] 

Sylvain Lebresne commented on CASSANDRA-5062:
---------------------------------------------

If a node receive a PROPOSE for round R there is 2 possible cases:
* either R is a round for which the node has already "learn" the value. In 
which case, we will take the "if (C_current.timestamp() >= R)" branch, i.e. the 
"repair the proposer that we know is behind"
* or R is a round for which the node hasn't already learn the value. In that 
case, we read whatever paxos state for round R. Whether round R has been 
"learned" by *other* replica doesn't matter at all. That is, say the last round 
the node has "learn" about is R_last, then it's absolutely possible for the R 
received in the propose to be R_last+1 or R_last+2 or R_last+whatever. The 
point being, every read of the paxos state is parametrized by the round itself. 
So a propose for round R_last+2 will look at what the replica has (or doesn't 
have) for round R_last+2 only (the state for round R_last+1 is not queried). 
Note that node can absolutely have state for more than one round at the same 
time, but it will never mix those by construction. 
                
> 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

Reply via email to