mirror of
https://github.com/minio/minio.git
synced 2025-04-01 10:13:42 -04:00
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
This commit is contained in:
parent
38eef5ce4c
commit
c2f7cd1104
@ -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.
|
// 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 {
|
func shouldHealObjectOnDisk(erErr, dataErr error, meta FileInfo, quorumModTime time.Time) bool {
|
||||||
switch erErr {
|
switch erErr {
|
||||||
case errFileNotFound:
|
case errFileNotFound, errFileVersionNotFound:
|
||||||
return true
|
return true
|
||||||
case errCorruptedFormat:
|
case errCorruptedFormat:
|
||||||
return true
|
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 er.meta was read fine but there may be problem with the part.N files.
|
||||||
if IsErr(dataErr, []error{
|
if IsErr(dataErr, []error{
|
||||||
errFileNotFound,
|
errFileNotFound,
|
||||||
|
errFileVersionNotFound,
|
||||||
errFileCorrupt,
|
errFileCorrupt,
|
||||||
}...) {
|
}...) {
|
||||||
return true
|
return true
|
||||||
@ -270,7 +271,7 @@ func (er erasureObjects) healObject(ctx context.Context, bucket string, object s
|
|||||||
driveState = madmin.DriveStateOffline
|
driveState = madmin.DriveStateOffline
|
||||||
case errs[i] == errFileNotFound, errs[i] == errVolumeNotFound:
|
case errs[i] == errFileNotFound, errs[i] == errVolumeNotFound:
|
||||||
fallthrough
|
fallthrough
|
||||||
case dataErrs[i] == errFileNotFound, dataErrs[i] == errVolumeNotFound:
|
case dataErrs[i] == errFileNotFound, dataErrs[i] == errFileVersionNotFound, dataErrs[i] == errVolumeNotFound:
|
||||||
driveState = madmin.DriveStateMissing
|
driveState = madmin.DriveStateMissing
|
||||||
default:
|
default:
|
||||||
// all remaining cases imply corrupt data/metadata
|
// all remaining cases imply corrupt data/metadata
|
||||||
|
Loading…
x
Reference in New Issue
Block a user