From 9bbc01384e70afa6aa25520909c2b3a616484aae Mon Sep 17 00:00:00 2001 From: "R.I.Pienaar" Date: Mon, 5 Dec 2022 21:16:25 +0100 Subject: [PATCH] Do not gather full state for snapshots This avoids hust state outputs for streams with many deleted items Signed-off-by: R.I.Pienaar --- server/filestore.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/filestore.go b/server/filestore.go index 782268c6..dce0414b 100644 --- a/server/filestore.go +++ b/server/filestore.go @@ -5748,7 +5748,8 @@ func (fs *fileStore) Snapshot(deadline time.Duration, checkMsgs, includeConsumer } // We can add to our stream while snapshotting but not delete anything. - state := fs.State() + var state StreamState + fs.FastState(&state) // Stream in separate Go routine. go fs.streamSnapshot(pw, &state, includeConsumers)