0

How does a group have multiple consensus at different point of time. Let me try to explain the question with an example. Let us assume that there 10 process, among them 3 are proposers(P0, P1, P2). A Paxos round concludes and every body agrees on the value (say v0) proposed by P0. P0 crashes and is removed from the group. Now if P1 and P2 propose new values then how there can be a consensus among the group members on the newly proposed values. Any value proposed with higher proposal number will always build consensus only on v0. Can we map this example to Leader election case, in which after current leader P0 is crashed, P1 and P2 wants to become leader.

user3038038
  • 36
  • 1
  • 4

1 Answers1

3

As you said - after majority of acceptors agreed on value (v0 in your case) - no other value can override it. After all, that's the point of consensus - majority agrees and never changes their mind.

So how can we use paxos when we do need to agree on a new value - e.g. because old leader is offline. The answer here is using Multi-paxos - which basically means that the system may have several consensus rounds happening one after another. When the system thinks a leader is down, then the system initiates a new paxos round to get new agreement.

A very typical approach to multi-paxos is to use epoch or term - an integer being always increased for every paxos consensus run. So in epoch 1 the leader is v0 - so the consensus is that for epoch 1 the leader is vo. After the system thinks v0 is down, new consensus is executed for a higher epoch - so v1 will be leader for epoch 2; and so on.

Always increasing epoch number helps the system to decide what is the latest state of the system. So if a participant receives a message for an older epoch - that participant may ignore it.

For the context - lots of people, including myself :) - are initially confused on how to apply paxos in practice because single instance of paxos never changes agreed value.

Assuming you learn consensus systems, my recommendation is to implement (or just play with) paxos, then multi-paxos and then raft.

AndrewR
  • 1,252
  • 8
  • 7