Consensus and RAFT’s Log replication

Problems that are related to the Consensus problem:

What is Consensus?

So, we have N processes and each process P has input variable $x_p$: initially either 0 or 1 ****and ****output variable $y_p$: initially undecided (can be changed only once)

Consensus problem: Design a protocol that

Every process contributes a value. The goal is to have all processes decide same (some) value and decision once made can’t be changed.

Consensus protocol must have all these three properties:

  1. Termination (Progress). All non-faulty processes eventually decide on a value
  2. Agreement. All processes that decide do so on the same value.
  3. Validity. The value that has been decided must have proposed by some process.

Many problems in distributed systems are equivalent to consensus, such as Perfect Failure Detection, Leader election (select exactly one leader, and every alive process knows about it) or Agreement (harder than consensus). So consensus is a very important problem.