Skip to content

Commit

Permalink
Add in additional warning when subject skew detected
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 28, 2023
1 parent 3d5564b commit cb74f3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/filestore.go
Expand Up @@ -3225,6 +3225,7 @@ func (fs *fileStore) enforceMsgPerSubjectLimit() {
// We had an issue with a use case where psim (and hence fss) were correct but idx was not and was not properly being caught.
// So do a quick sanity check here. If we detect a skew do a rebuild then re-check.
if numMsgs != fs.state.Msgs {
fs.warn("Detected skew in subject-based total (%d) vs raw total (%d), rebuilding", numMsgs, fs.state.Msgs)
// Clear any global subject state.
fs.psim = make(map[string]*psi)
for _, mb := range fs.blks {
Expand Down

0 comments on commit cb74f3f

Please sign in to comment.