From 21ecb941fe92dee713d73710ff9d8a30c39d17c7 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 10 Oct 2023 14:39:48 -0700 Subject: [PATCH] fix: avoid counting out of band deletes during disk heal (#18205) --- cmd/global-heal.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/global-heal.go b/cmd/global-heal.go index 90842bd31..b7c1848f7 100644 --- a/cmd/global-heal.go +++ b/cmd/global-heal.go @@ -309,7 +309,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string, Remove: healDeleteDangling, }) if err != nil { - if isErrObjectNotFound(err) { + if isErrObjectNotFound(err) || isErrVersionNotFound(err) { // queueing happens across namespace, ignore // objects that are not found. return @@ -335,7 +335,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string, ScanMode: scanMode, Remove: healDeleteDangling, }); err != nil { - if isErrObjectNotFound(err) { + if isErrObjectNotFound(err) || isErrVersionNotFound(err) { // queueing happens across namespace, ignore // objects that are not found. versionNotFound++ @@ -344,9 +344,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string, // If not deleted, assume they failed. result = healEntryFailure(uint64(version.Size)) if version.VersionID != "" { - if !isErrVersionNotFound(err) { - logger.LogIf(ctx, fmt.Errorf("unable to heal object %s/%s-v(%s): %w", bucket, version.Name, version.VersionID, err)) - } + logger.LogIf(ctx, fmt.Errorf("unable to heal object %s/%s-v(%s): %w", bucket, version.Name, version.VersionID, err)) } else { logger.LogIf(ctx, fmt.Errorf("unable to heal object %s/%s: %w", bucket, version.Name, err)) } @@ -358,7 +356,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string, return } } - // All versions resulted in 'ObjectNotFound' + // All versions resulted in 'ObjectNotFound/VersionNotFound' if versionNotFound == len(fivs.Versions) { return }