Search code examples
distributed-systemconsensusraft

raft: state is not determined


  1. assume a cluster with 7 nodes N1, N2, ...N7, with state x=2
  2. assume N1 is the leader node
  3. then a client send x=5 to leader node N1, and N1 replicate x=5 to node N6 and N7(uncommitted), but N2~N5 didn't receive this RPC
  4. at this moment, N1 crashed, so, a new election triggered, my question is bellow:

    • if N6 win this election, the state in cluster will be x=5(uncommitted will become committed)
    • if N2 win this election, the state in cluster will be x=2(uncommitted in N6/N7 will be discard)

Did I misunderstand something? Thanks!


Solution

  • Yes, you are correct, depending on who becomes leader the inflight uncommitted entries may get committed, or may get dropped.