From 85784a384b4c47c66306c044ccfb182611de4231 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Thu, 26 Oct 2023 19:27:41 -0700 Subject: [PATCH] Only load msgs if mb.fss has been evicted. Signed-off-by: Derek Collison --- server/filestore.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/filestore.go b/server/filestore.go index 4fcbea4d759..3157e6784f4 100644 --- a/server/filestore.go +++ b/server/filestore.go @@ -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 } @@ -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