Operational reality — pipelining, batching, and the no-op trick
The no-op-on-election rule — one empty log entry appended the instant a server becomes leader — is the single mechanism that discharges three correctness obligations the curriculum has been collecting (Figure 8 commit propagation, ReadIndex correctness, single-server membership-change safety); the remaining operational realities — pipelining, batching, leadership transfer, ElectionTick tuning — are throughput and availability tuning around the fsync floor that dominates every Raft server.
Across earlier scenes the phrase 'no-op on election' has been mentioned three times — scene 5 used it to commit prior-term entries via the current-term rule (Figure 8), scene 7 used it to close the 2015 single-server membership-change hole, and scene 9 used it to make ReadIndex correct from the moment of election. Each time, the rule was a forward reference. This scene looks at it directly and reveals that the same one log entry is doing all three jobs.
Scene 10
Operational reality — the no-op trick, pipelining, batching, fsync
- Watch
- Try it
- Predict
- Capture
You've seen the same rule mentioned three times already — in scene 5 (the Figure 8 fix), in scene 7 (the single-server membership-change fix), and in scene 9 (ReadIndex correctness). Each time it was a forward pointer to here. It's time to look at it directly. The rule, in plain English: the moment a server becomes leader, it appends one empty log entry of its current term and replicates it. That single act discharges three correctness obligations the curriculum has been collecting. The formal name: no-op on election. Formal statement: a newly-elected leader appends and replicates a single empty (no-op) entry of its own term before serving any other work. S2 has just won the election for term 4. Watch the first AppendEntries it broadcasts — it carries exactly one entry, the no-op. The next phase reveals why the same entry shows up in three otherwise-disjoint correctness proofs.
Highlighted lines are the ones running in the diagram right now.
def onElectionWin(self, newTerm):# 1. append a no-op entry of OUR term — the load-bearing tricknoop = LogEntry(term=newTerm, payload=NOOP, index=self.lastIndex+1)self.appendAndReplicate(noop)# 2. block downstream operations until the no-op commitsself.pendingReadIndexMessages = [] # scene 9self.pendingConfigChanges = [] # scene 7 (Ongaro 2015 fix)self.waitForCommit(noop.index)# 3. once committed, three obligations discharged at once:# a. prior-term entries on this majority commit transitively# (current-term commit rule, scene 5 / Figure 8)# b. commitIndex now reflects OUR term — ReadIndex safe# (scene 9, drains pendingReadIndexMessages)# c. configuration changes may now be appended# (scene 7, drains pendingConfigChanges)
- paperConsensus: Bridging Theory and Practice — Chapter 9 (Extensions)
- paperIn Search of an Understandable Consensus Algorithm — §6 + §8
- codeetcd-io/raft — design.md (pipelining, batching, ReadIndex)
- blogImplementing Raft in Rust (TiKV) — Operational Notes
- blogWhy etcd elections take 1 second (and what that means)
- codehashicorp/raft — leadership transfer + TimeoutNow
Where this sits in Build Raft — consensus you can defend
Scene 10 of 12. The no-op-on-election rule does triple duty: Figure 8 fix, ReadIndex correctness, single-server change safety. Plus the throughput knobs (pipelining, batching) and graceful TimeoutNow handoff that separate paper Raft from deployed Raft.
Up next. Every safety mechanism is now defended, the no-op trick is unified, and every operational reality — fsync floors, pipelining limits, batching trade-offs, graceful handoff — is named. You have the complete toolkit needed to walk into scene 11 and commit to a production Raft configuration for a specific workload: election timeout, batch window, read mode, membership strategy, snapshot cadence — each choice defendable against the invariants that justify it.
All 12 scenes in Build Raft — consensus you can defend · Every curriculum