Skip to content

Commit

Permalink
Only load msgs if mb.fss has been evicted.
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <[email protected]>
  • Loading branch information
derekcollison committed Oct 27, 2023
1 parent c999177 commit 85784a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2426,7 +2426,7 @@ func (fs *fileStore) SubjectsState(subject string) map[string]SimpleState {
fs.mu.RLock()
defer fs.mu.RUnlock()

if fs.state.Msgs == 0 {
if fs.state.Msgs == 0 || fs.noTrackSubjects() {
return nil
}

Expand Down Expand Up @@ -2454,7 +2454,7 @@ func (fs *fileStore) SubjectsState(subject string) map[string]SimpleState {

mb.mu.Lock()
var shouldExpire bool
if mb.cacheNotLoaded() {
if mb.fss == nil {
// Make sure we have fss loaded.
mb.loadMsgsWithLock()
shouldExpire = true
Expand Down

0 comments on commit 85784a3

Please sign in to comment.