From f28b06309116f73c4453a72fafadce9a892e1edf Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Fri, 19 Feb 2021 00:16:20 +0100 Subject: [PATCH] heal: Use healDeleteDangling global const in self healing (#11579) A small fix, use healDeleteDangling constant instead of 'true' in the self-healing code. --- cmd/data-scanner.go | 2 +- cmd/global-heal.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index a2ff06ec4..953d837ba 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -637,7 +637,7 @@ func (f *folderScanner) scanQueuedLevels(ctx context.Context, folders []cachedFo objAPI.HealObjects(ctx, bucket, prefix, madmin.HealOpts{ Recursive: true, - Remove: true, + Remove: healDeleteDangling, }, func(bucket, object, versionID string) error { // Wait for each heal as per scanner frequency. diff --git a/cmd/global-heal.go b/cmd/global-heal.go index e27bc87d4..f01656cc8 100644 --- a/cmd/global-heal.go +++ b/cmd/global-heal.go @@ -165,7 +165,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []BucketIn } waitForLowHTTPReq(globalHealConfig.IOCount, globalHealConfig.Sleep) for _, version := range fivs.Versions { - if _, err := er.HealObject(ctx, bucket.Name, version.Name, version.VersionID, madmin.HealOpts{ScanMode: madmin.HealNormalScan, Remove: true}); err != nil { + if _, err := er.HealObject(ctx, bucket.Name, version.Name, version.VersionID, madmin.HealOpts{ScanMode: madmin.HealNormalScan, Remove: healDeleteDangling}); err != nil { if !isErrObjectNotFound(err) && !isErrVersionNotFound(err) { logger.LogIf(ctx, err) }