Skip to content

Commit

Permalink
ignore ood ae reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenMathew committed Jul 12, 2024
1 parent ec50bdc commit 38cc515
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -3294,8 +3294,14 @@ func (n *raft) processAppendEntry(ae *appendEntry, sub *subscription) {
n.debug("Term higher than ours and we are not a follower: %v, stepping down to %q", n.State(), ae.leader)
n.stepdownLocked(ae.leader)
}
} else if ae.term < n.term {
// ignore
n.debug("ignoring ae req from a leader with term %d which is less than ours")
return
}
// FIX: we need to handle if term is less than ours as well, we should be ignoring the entry

// BUG: leader was being updated even if the leader's term was out of date (behind ours)
if isNew && n.leader != ae.leader && n.State() == Follower {
n.debug("AppendEntry updating leader to %q", ae.leader)
n.updateLeader(ae.leader)
Expand Down

0 comments on commit 38cc515

Please sign in to comment.