mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 18:20:42 -07:00
Move to past check for nil
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -6801,12 +6801,6 @@ func (mset *stream) processSnapshot(snap *streamSnapshot) (e error) {
|
||||
qname := fmt.Sprintf("[ACC:%s] stream '%s' snapshot", mset.acc.Name, mset.cfg.Name)
|
||||
mset.mu.Unlock()
|
||||
|
||||
// See if our state's first sequence is >= the leader's snapshot.
|
||||
// This signifies messages have been expired, purged, deleted and the leader no longer has them.
|
||||
if snap.FirstSeq < state.FirstSeq {
|
||||
sreq.FirstSeq = state.FirstSeq + 1
|
||||
}
|
||||
|
||||
// Bug that would cause this to be empty on stream update.
|
||||
if subject == _EMPTY_ {
|
||||
return errCatchupCorruptSnapshot
|
||||
@@ -6817,6 +6811,12 @@ func (mset *stream) processSnapshot(snap *streamSnapshot) (e error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// See if our state's first sequence is >= the leader's snapshot.
|
||||
// This signifies messages have been expired, purged, deleted and the leader no longer has them.
|
||||
if snap.FirstSeq < state.FirstSeq {
|
||||
sreq.FirstSeq = state.FirstSeq + 1
|
||||
}
|
||||
|
||||
// Pause the apply channel for our raft group while we catch up.
|
||||
if err := n.PauseApply(); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user