mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix deletecount bug (#3499)
This commit is contained in:
parent
21a933c932
commit
762dc219a6
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
"github.com/seaweedfs/seaweedfs/weed/storage/idx"
|
||||
. "github.com/seaweedfs/seaweedfs/weed/storage/types"
|
||||
"github.com/tylertreat/BoomFilters"
|
||||
boom "github.com/tylertreat/BoomFilters"
|
||||
)
|
||||
|
||||
type mapMetric struct {
|
||||
|
@ -106,7 +106,12 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) {
|
|||
}
|
||||
|
||||
mm.FileCounter++
|
||||
if bf.TestAndAdd(buf) {
|
||||
if !bf.TestAndAdd(buf) {
|
||||
// if !size.IsValid(), then this file is deleted already
|
||||
if !size.IsValid() {
|
||||
mm.DeletionCounter++
|
||||
}
|
||||
} else {
|
||||
// deleted file
|
||||
mm.DeletionCounter++
|
||||
if size.IsValid() {
|
||||
|
|
Loading…
Reference in a new issue