Skip to content

Commit

Permalink
[IMPROVED] Make sure to issue warning on reset for bad state (#4583)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Sep 25, 2023
2 parents 33d8de7 + e46f49f commit 3ecb741
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/jetstream_cluster.go
Expand Up @@ -2933,6 +2933,10 @@ func (js *jetStream) applyStreamEntries(mset *stream, ce *CommittedEntry, isReco
// If we are the leader or recovering, meaning we own the snapshot,
// we should stepdown and clear our raft state since our snapshot is bad.
if isRecovering || mset.IsLeader() {
mset.mu.RLock()
s, accName, streamName := mset.srv, mset.acc.GetName(), mset.cfg.Name
mset.mu.RUnlock()
s.Warnf("Detected bad stream state, resetting '%s > %s'", accName, streamName)
mset.resetClusteredState(err)
}
}
Expand Down

0 comments on commit 3ecb741

Please sign in to comment.