Leader commits only current-term entries, counted by majority
@matnvd▲ 0 net votes
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.