From b9763c19ff4f5ed4e1ccbcb279c0bc2d8e8c55c9 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Wed, 14 Feb 2024 10:16:01 -0800 Subject: [PATCH] Move reallocation warnings on psim to debug. They should not happen, but it is possible and not actionable by operators, so debug is better. Signed-off-by: Derek Collison --- server/filestore.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/filestore.go b/server/filestore.go index 5e69f472083..97f4adefc82 100644 --- a/server/filestore.go +++ b/server/filestore.go @@ -1466,6 +1466,16 @@ func (fs *fileStore) warn(format string, args ...any) { fs.srv.Warnf(fmt.Sprintf("Filestore [%s] %s", fs.cfg.Name, format), args...) } +// For doing debug logging. +// Lock should be held. +func (fs *fileStore) debug(format string, args ...any) { + // No-op if no server configured. + if fs.srv == nil { + return + } + fs.srv.Debugf(fmt.Sprintf("Filestore [%s] %s", fs.cfg.Name, format), args...) +} + // Track local state but ignore timestamps here. func updateTrackingState(state *StreamState, mb *msgBlock) { if state.FirstSeq == 0 { @@ -7542,7 +7552,7 @@ func (fs *fileStore) writeFullState() error { } if cap(buf) > sz { - fs.warn("WriteFullState reallocated from %d to %d", sz, cap(buf)) + fs.debug("WriteFullState reallocated from %d to %d", sz, cap(buf)) } // Write to a tmp file and rename.