Skip to content
HSE · Lecture 05

Consensus and coordination

How can a leader change preserve acknowledged history?

Distributed Systems · HSE · 05

Slide contents

  1. 1. Consensus and coordination

    How can a leader change preserve acknowledged history?

  2. 2. Two nodes can believe they are leaders

    Safety cannot rely on local belief alone.

  3. 3. An identical log defines identical transitions

    Deterministic state machines apply commands in order.

  4. 4. A term monotonically separates leadership attempts

    A higher term makes a node abandon its old role.

  5. 5. Five participants require a majority of three

    Any two majorities of fixed membership intersect.

  6. 6. An election needs a majority in one term

    A timeout starts an attempt, not a proof of death.

  7. 7. Freshness compares the last term before length

    Compare the last index only when last terms are equal.

  8. 8. Index gives position; term gives the entry’s origin

    The command and two numbers serve different roles.

  9. 9. AppendEntries starts by checking the shared prefix

    A follower checks prevLogIndex and prevLogTerm.

  10. 10. Persist votes and logs before dependent replies

    Restart must not erase protocol obligations.

  11. 11. A leader counts a majority for its current-term entry

    After commitment, apply the preceding prefix in order.

  12. 12. An old-term entry cannot commit by replica count alone

    Figure 8 shows such a suffix being legitimately replaced.

  13. 13. A committed new entry secures its older prefix

    A current-term no-op is also a log entry.

  14. 14. A majority can elect without the minority

    A,B are isolated from C,D,E.

  15. 15. A former leader must not serve strict reads from memory alone

    It may not know about the majority’s new commit.

  16. 16. A returning node replaces its conflicting suffix

    A higher term removes old authority.

  17. 17. Accepting, choosing, and learning are different events

    Paxos makes these boundaries explicit.

  18. 18. FLP limits universal termination

    Determinism; asynchrony; reliable delivery; one possible crash-stop.

  19. 19. Progress needs communication before repeated elections

    broadcastTime ≪ electionTimeout ≪ MTBF is the paper’s guideline.

  20. 20. A durable log does not infer client intent

    A lost reply requires the same operation key.

  21. 21. The resource checks the owner’s generation itself

    Acquiring a lock does not stop an old request.

  22. 22. Reject an old token after accepting a newer one

    Teaching generations: A=41, B=42.

  23. 23. Uncommitted X may be replaced by Y

    X is only on A,B; Y commits on C,D,E.

  24. 24. Determine commitment, reads, and suffix fate

    Five nodes, shared index1, split A,B | C,D,E.

  25. 25. The lab checks data, availability, and recovery separately

    Three etcd members produce a 2/1 partition.

    Acknowledged tasks remain

    Minority cannot commit writes

    Read mode is explicit

    Lagging node caught up

  26. 26. Decisions for our service

    Determine commitment using the entry’s term.

    Trace elections and conflicting-suffix repair.

    Separate log consensus from resource fencing.