On stepdown still process appendEntry

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-01-25 14:32:24 -08:00
parent 7d8c3eaa6e
commit 7eb6d07bfc

View File

@@ -1532,9 +1532,9 @@ func (n *raft) processAppendEntry(ae *appendEntry, sub *subscription) {
if n.state == Candidate {
n.debug("Received append entry in candidate state from %q, converting to follower", ae.leader)
n.term = ae.term
n.Unlock()
n.vote = noVote
n.writeTermVote()
n.stepdown <- ae.leader
return
}
// Catching up state.
@@ -1592,9 +1592,7 @@ func (n *raft) processAppendEntry(ae *appendEntry, sub *subscription) {
n.writeTermVote()
if n.state != Follower {
n.debug("Term higher than ours and we are not a follower: %v, stepping down to %q", n.state, ae.leader)
n.Unlock()
n.stepdown <- ae.leader
return
}
}