mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
If a leader is asked for an item and we have no items left, make sure to also step-down.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -2509,6 +2509,10 @@ func (n *raft) catchupFollower(ar *appendEntryResponse) {
|
||||
}
|
||||
if err != nil || ae == nil {
|
||||
n.warn("Could not find a starting entry for catchup request: %v", err)
|
||||
// If we are here we are seeing a request for an item we do not have, meaning we should stepdown.
|
||||
// This is possible on a reset of our WAL but the other side has a snapshot already.
|
||||
// If we do not stepdown this can cycle.
|
||||
n.stepdown.push(noLeader)
|
||||
n.Unlock()
|
||||
arPool.Put(ar)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user