heal: Use healDeleteDangling global const in self healing (#11579)

A small fix, use healDeleteDangling constant instead of 'true' in the
self-healing code.
master
Anis Elleuch 4 years ago committed by GitHub
parent 90abea5b7a
commit f28b063091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/data-scanner.go
  2. 2
      cmd/global-heal.go

@ -637,7 +637,7 @@ func (f *folderScanner) scanQueuedLevels(ctx context.Context, folders []cachedFo
objAPI.HealObjects(ctx, bucket, prefix, madmin.HealOpts{ objAPI.HealObjects(ctx, bucket, prefix, madmin.HealOpts{
Recursive: true, Recursive: true,
Remove: true, Remove: healDeleteDangling,
}, },
func(bucket, object, versionID string) error { func(bucket, object, versionID string) error {
// Wait for each heal as per scanner frequency. // Wait for each heal as per scanner frequency.

@ -165,7 +165,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []BucketIn
} }
waitForLowHTTPReq(globalHealConfig.IOCount, globalHealConfig.Sleep) waitForLowHTTPReq(globalHealConfig.IOCount, globalHealConfig.Sleep)
for _, version := range fivs.Versions { 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) { if !isErrObjectNotFound(err) && !isErrVersionNotFound(err) {
logger.LogIf(ctx, err) logger.LogIf(ctx, err)
} }

Loading…
Cancel
Save