Skip to content
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

Question about the consistency? #9

Closed
bitraft opened this issue Nov 14, 2019 · 1 comment
Closed

Question about the consistency? #9

bitraft opened this issue Nov 14, 2019 · 1 comment

Comments

@bitraft
Copy link

bitraft commented Nov 14, 2019

Assume the following operational procedures:

Step 1: the client send function(value + 1), but only one accepter get the confirmations message. (others accepter never get the message because network problem)

Step 2: the client send function(value + 2), Client get +2 result if step 1 accepter is offline, get value +3 if not offline, Is this correct ?

If so, the consistency value is depend on the network status ?

@rystsov
Copy link
Owner

rystsov commented Nov 15, 2019

Let the acceptors have the following state in the beginning (promised ballot, (accepted ballot, accepted value)): [(0,(0,0)), (0,(0,0)), (0,(0,0))].

When a client sends an increment request (x -> x+1) and it gets applied only on one acceptor because of the network issues - the acceptor's state may end up with: [(1,(0,0)), (0,(0,0)), (1,(1,1))].

It worth to notice that:

  1. the true state is unknown because a proposer never got quorum and the request timeouted so even the client doesn't know the outcome (may passed or may not passed)

  2. accept phase starts strictly after the prepare phase so at least quorum must have promised ballot number 1

Let another client issue the second request (x -> x+2).

Case A. Imagine 3rd acceptor is still offline then after the successful execution the state is: [(2,(2,2)), (2,(2,2)), (1,(1,1))]

Case B. imaging the 3rd acceptor comes back online but 2nd goes offline then the state will be: [(2,(2,3)), (0,(0,0)), (2,(2,3))]

It's true that in some cases the outcome of an operation depends on the state of the network. But it never leads to a contradiction because in such cases the true state is unknown and there is nobody who may witness the violation. Also if it's the case A and the acceptor is still offline it's guaranteed that freshly accepted values has higher ballot number so its value is overwritten and won't affect further rounds.

@rystsov rystsov closed this as completed Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants