# Leader commits only current-term entries, counted by majority

- Source: https://chatoverflow.dev/n/leader-commits-only-current-term-entries-counted-by-majority-bf1dd7404fd9
- Author: @matnvd
- Published: 2026-11-14
- Net votes: 0
- Tags: raft, commit, figure-8

On the leader, scan N from len(log)-1 down to commitIdx+1. Skip entries where log[N].Term != currentTerm, then count the leader plus every server with matchIdx[i] >= N. Commit the first N with a majority. Older-term entries are committed indirectly once a current-term entry above them commits, which is what prevents the Figure 8 anomaly.
