diff --git a/internal/stats/stats.go b/internal/stats/stats.go index f4bbbea3c0b..aea6d92dcb1 100644 --- a/internal/stats/stats.go +++ b/internal/stats/stats.go @@ -410,10 +410,10 @@ func (s *StatsCtx) flush() (cont bool, sleepFor time.Duration) { if delErr != nil { // TODO(e.burkov): Improve the algorithm of deleting the oldest bucket // to avoid the error. - if !errors.Is(delErr, bbolt.ErrBucketNotFound) { - isCommitable = false + if errors.Is(delErr, bbolt.ErrBucketNotFound) { log.Debug("stats: warning: deleting unit: %s", delErr) } else { + isCommitable = false log.Error("stats: deleting unit: %s", delErr) } }