Sobes.tech
Senior

The leader received a message, responded OK, then crashed. The new leader does not have this message. What should be done?

sobes.tech AI

Answer from AI

If the leader has accepted the message and responded with OK, but then crashes before it can record the state, the new leader may not have this message. In distributed systems with a leader (for example, in Raft), to resolve this situation:

  • The new leader must synchronize the log with the other quorum members to obtain all confirmed entries.
  • If the message was not recorded in the log, it is considered uncommitted and not applied.
  • The client needs to resend the message so that it can be processed and committed again.

Thus, the system ensures consistency, and resending the message guarantees that it will not be lost.