From c7892bc7c4a5df48cc1db946243573b3ded3d711 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 20 Aug 2022 23:35:31 -0700 Subject: [PATCH] volume: file counter should be all files address https://github.com/seaweedfs/seaweedfs/pull/3388#issuecomment-1220466228 --- weed/storage/needle_map_metric.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/weed/storage/needle_map_metric.go b/weed/storage/needle_map_metric.go index 0ce616131..abf6b4b8b 100644 --- a/weed/storage/needle_map_metric.go +++ b/weed/storage/needle_map_metric.go @@ -105,9 +105,8 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) { mm.FileByteCounter += uint64(size) } - if !bf.TestAndAdd(buf) { - mm.FileCounter++ - } else { + mm.FileCounter++ + if bf.TestAndAdd(buf) { // deleted file mm.DeletionCounter++ if size.IsValid() {