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

Unmesh Joshi commented on CASSANDRA-17162:
------------------------------------------

Consider following scenario

Alice, Bob and Mary are trying to set their names on servers A, B and C.


Alice tries to propose name=Alice at timestamp ballot 100

A promises with in-progress-ballot 100
B promises in-progress-ballot 100
C is not reached


Alice gets majority promises 

A is not reachable and goes in a retry loop.
B is not reachable and goes in a retry loop.
C is not reachable and goes in a retry loop.


Bob tries to propose name=Bob at timestamp ballot 200

A promises with in-progress-ballot 200
B promises with in-progress-ballot 200
C is not reachable.

Bob gets majority of promises

A is not reachable
B accepts proposal 200, Bob. proposal-ballot set to 200.
C accepts proposal 200, Bob, proposal-ballot set to 200


Alice's retries work

A rejects proposal because in-progress-ballot is set to 200.
B is not reachable.
C accepts proposal 100, Alice. proposal-ballot set to 100. (overwriting value 
Bob, because Bob's acceptance did not set in-progress-ballot).


Mary tries a proposal at timestamp ballot 300

A promises with in-progress-ballot set to 300 
B is unreachable
C promises with in-progress-ballot set to 300 and returns proposal-ballot 100 
and value Alice.

Mary gets majority promises for ballot 300 and chooses value Alice.

A accepts proposal 300 with value Alice
B accepts proposal 300 with value Alice
C accepts proposal 300 with value Alice


So unless the proposal sets and checks in-progress ballot, the values can 
potentially be overwritten with delayed proposals?
Or am i missing something in this scenario?

> In the paxos implementation, a delayed proposal might overwrite newer values
> ----------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17162
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Unmesh Joshi
>            Priority: Normal
>         Attachments: paxos-fix.patch
>
>
> I was going through this blog post , which talks about a possible bug in 
> paxos implementation if in-progress ballot is not set while accepting a 
> proposal.
> [https://brooker.co.za/blog/2021/11/16/paxos.html]
> I tried writing a failing test and possible fix. 
> The in_progress_ballot needs to be set when accepting a proposal. The current 
> implementation sets only the proposal_ballot when accepting a proposal.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to