Do proposal numbers need to be unique in Paxos?

可紊 提交于 2021-01-28 21:11:04

问题


What can happen if two proposals are issued with the same ProposalId? It shouldn't create any problem if they have the same value. But what about different values? I can work out a scenario where it risks liveness at the time of failure, but would it create any problem for the protocol's safety?


回答1:


It's a nice idea because it would ease an annoying design requirement for a practical system: designing a scheme to ensure proposers have different, yet increasing round numbers.

It doesn't work, unfortunately.

Let's define PaxosPrime to be a variation of Paxos where different proposers are allowed to have the same round numbers. We show through contradiction that PaxosPrime is not a consensus algorithm.

Proof sketch: Assume PaxosPrime is a consensus algorithm. Let's consider where each acceptor has a different value, but with the same round (w.l.o.g we'll pick 3). Each will also have promised at 3. We then have a pair of proposers interact in the system.

A1    | A2    | A3
v   p | v   p | v   p  
------+-------+------
x@3 3 | y@3 3 | z@3 3
  1. P1 prepares for round 4 (i.e. Phase 1.A) and receives all three values x@3, y@3, and z@3. There is no provision in Paxos for tie-breaking, so we'll have it choose x.
  2. P2 also prepares for round 4 and receives y@3 and z@3 from A2 and A3, respectively. We'll have it choose y.
  3. P1 sends accepts for x@4 (i.e. Phase 2.A) and the acceptors all process it. At this point all the acceptors have value v@4 and promises for 4. The system has consensus on the value x.
  4. P2 sends accepts for round y@4 and the acceptors A2 and A3 successfully process it. A majority of the acceptors now have value y@4; The system has consensus on the value y.

Here is the trace from the acceptors' point of view:

A1    | A2    | A3
v   p | v   p | v   p  
------+-------+------
x@3 3 | y@3 3 | z@3 3  # Start
x@3 4 | y@3 4 | z@3 4  # Process P1's propose command
x@3 4 | x@3 4 | x@3 4  # Process P1's accept command
x@3 4 | y@3 4 | y@3 4  # Process P2's accept command

The system first had consensus on the value x then consensus on the value y. This is a contradiction on the definition of consensus; thus PaxosPrime is not a consensus algorithm.




来源:https://stackoverflow.com/questions/64862200/do-proposal-numbers-need-to-be-unique-in-paxos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!