Skip to content

Commit

Permalink
Move reallocation warnings on psim to debug.
Browse files Browse the repository at this point in the history
They should not happen, but it is possible and not actionable by operators, so debug is better.

Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison authored and wallyqs committed Feb 14, 2024
1 parent fb6640a commit b9763c1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit b9763c1

Please sign in to comment.