Skip to content

Commit

Permalink
Merge pull request #2814 from nats-io/neg_deleted
Browse files Browse the repository at this point in the history
If we detect negative deleted, adjust to 0.
  • Loading branch information
derekcollison committed Jan 24, 2022
2 parents dc39723 + d07000c commit 35e8c57
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/filestore.go
Expand Up @@ -3427,6 +3427,9 @@ func (fs *fileStore) FastState(state *StreamState) {
state.LastTime = fs.state.LastTime
if state.LastSeq > state.FirstSeq {
state.NumDeleted = int((state.LastSeq - state.FirstSeq + 1) - state.Msgs)
if state.NumDeleted < 0 {
state.NumDeleted = 0
}
}
state.Consumers = len(fs.cfs)
fs.mu.RUnlock()
Expand Down

0 comments on commit 35e8c57

Please sign in to comment.