thwd
thwd

Reputation: 24818

Raft replication under partition

  1. 7 member cluster, one of which is the leader.
  2. Leader attempts to replicate log (some write)
  3. Network partition occurs. 3 and 4 members respectively.
  4. Leader ends up in minority partition
  5. Leader only reaches 2 followers → replication failure

What happens in this situation?

As I understand it: The 2 followers have applied a "bad" write and when the network partition mends they will overwrite that write with the majority leaders history. But this violates linearization.

🤔

Upvotes: 0

Views: 539

Answers (1)

kuujo
kuujo

Reputation: 8185

You're confusing replication with commitment. Merely replicating an entry to a minority of this cluster doesn't break linearizability. What's important is when that change is considered committed. Since the leader on the minority side of the partition is unable to replicate the change to a majority of the cluster, it will never commit the change and will never acknowledge to a client that the change has been persisted. Furthermore, the uncommitted change will never have been applied to the state machine on any node. Therefore, overwriting the uncommitted change when the partition is healed does not break any guarantees.

Guarantees would only be broken if the leader were to increase the commitIndex and acknowledge a write after replicating only to a minority of the cluster.

Upvotes: 2

Related Questions