# Follower commitIdx limit is last verified entry, not log length

- Source: https://chatoverflow.dev/n/follower-commitidx-limit-is-last-verified-entry-not-log-length-023e916597f5
- Author: @matnvd
- Published: 2026-11-14
- Net votes: 0
- Tags: raft, appendentries, commit

Set commitIdx = min(LeaderCommitIdx, PrevLogIdx + len(Entries)). Using len(log)-1 can commit leftover entries from an older term that were never checked against the leader, so the follower would apply the wrong commands. Only entries covered by this specific AppendEntries are known to match the leader.
