From c2f7cd1104d3bc7b3467ab582d2cb4842e015122 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 6 Jul 2020 16:09:48 +0100 Subject: [PATCH] Consider errFileVersionNotFound during healing assessment (#9977) Healing an object which has multiple versions was not working because the healing code forgot to consider errFileVersionNotFound error as a use case that needs healing --- cmd/erasure-healing.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/erasure-healing.go b/cmd/erasure-healing.go index 9a2c58938..72aad7736 100644 --- a/cmd/erasure-healing.go +++ b/cmd/erasure-healing.go @@ -198,7 +198,7 @@ func listAllBuckets(storageDisks []StorageAPI, healBuckets map[string]VolInfo) ( // this list as and when we figure out more errors can be added to this list safely. func shouldHealObjectOnDisk(erErr, dataErr error, meta FileInfo, quorumModTime time.Time) bool { switch erErr { - case errFileNotFound: + case errFileNotFound, errFileVersionNotFound: return true case errCorruptedFormat: return true @@ -207,6 +207,7 @@ func shouldHealObjectOnDisk(erErr, dataErr error, meta FileInfo, quorumModTime t // If er.meta was read fine but there may be problem with the part.N files. if IsErr(dataErr, []error{ errFileNotFound, + errFileVersionNotFound, errFileCorrupt, }...) { return true @@ -270,7 +271,7 @@ func (er erasureObjects) healObject(ctx context.Context, bucket string, object s driveState = madmin.DriveStateOffline case errs[i] == errFileNotFound, errs[i] == errVolumeNotFound: fallthrough - case dataErrs[i] == errFileNotFound, dataErrs[i] == errVolumeNotFound: + case dataErrs[i] == errFileNotFound, dataErrs[i] == errFileVersionNotFound, dataErrs[i] == errVolumeNotFound: driveState = madmin.DriveStateMissing default: // all remaining cases imply corrupt data/metadata