Question

Node_1 is leader, node_2 die by accident, Node_1 needs to rerun Paxos since the Paxos value has something with current nodes dying or living. But there will be only 1 node (node_1 itself) agree this proposal, node_2 will not response. This conditon can't reach that "pass half of the nodes agree, ie, 2 of the nodes". How can it work?

Was it helpful?

Solution 2

if node_1 is only proposer then the system can not decide for a proposal. if node_1 (let's say v) and node_2(let's say v') are both acceptors and proposers then the algorithm can decide for the accepted proposal. Assume that node v tries to propose v value and node v' tries to propose v' value. So, let's see the following example. Proposer v sends a prepare with number 3. The acceptors have previous values so send back ACK-prepare with the previous proposals. Then the v' dies unexpectedly. But the "v" acceptor keeps running and accepts the proposal v' made by v proposer. Then, the acceptor sends ACK-proposal and the system ends with a decision.

Paxos Paradigm

To make our example more efficient, the accepted value is the value of proposer v' (that has died). But before died send the v' value with number 2 that is the final decided value.

The algorithm has the following assumptions:

  • Network can delay packets
  • reorder packets
  • lose packets
  • BUT not corrupt packets

if you havent read this, take a look..

OTHER TIPS

Paxos does not work with two nodes unless both nodes are working. To survive F nodes failing you need n>=2F+1 nodes in total. This means to survive one node failing you need a three node cluster. Two failures requires five nodes. This follows because a value is only chosen when it is accepted a majority. If we have two nodes the majority is two and both nodes must accept the value for it to be chosen. If we have three nodes then a majority is two and we can survive a single node failure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top