Title here could be misleading. I will try my best to explain my doubt through an example.
I am reading about paxos algorithm from wiki and other sources.
1) Imagine a situation where a client's request to update a value (X
in below example) is processed.
After one round of Paxos, a value Vb
is chosen because Acceptors reply's to Proposers contain their previously accepted Proposal number and the corresponding value. In the case below, the three acceptors send (8,Va),(9,Vb),(7,Vc)
to proposer which currently has (10,X)
. It picks up (9,Vb)
since it is the highest proposal number it received and broadcast the value (10,Vb)
to all acceptors for acceptance. So the initial value X
for which this whole round of Paxos was processed never got updated. so is the client transaction of updating to X failed in this case?
What is the final state of Acceptors after this? Do they all have (10,Vb)
as their highest accepted proposal number and values and thus be in sync?
Client Proposer Acceptor Learner | | | | | | | --- First Request --- X-------->| | | | | | Request | X--------->|->|->| | | Prepare(10) | |<---------X--X--X | | Promise(10,{(8,Va),(9,Vb),(7,Vc)} | X--------->|->|->| | | Accept!(10,9,Vb) | |<---------X--X--X------>|->| Accepted(10,9,Vb) |<---------------------------------X--X Response | | | | | | |
2) Now is a more complex case, where two proposals are made but at different time points when trying to reach consensus. That is imagine a situation where a client C1 in Region A is modifying some data X
and has not yet reached consensus while client C2 in Region B is modifying same data X
. Is one of Client's request rejected? please note C2 happens later than C1 but just that consensus has not reached yet. If ordering is followed, C1 request must be finished, consensus accepted and then C2 request be processed. From my understanding of this blog, in this case, C1 request value is chosen.
So Is C2 request abandoned? that might not be a good option.
Example (Copyright from this blog):
In this case, the v=8
is chosen finally, although request for V=5
is the most recent updated requested by client. why is it so? This could have serious impacts
Thanks for help and a happy new year!