mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
Only heal on disks where we are sure that healing is needed (#7148)
This commit is contained in:
committed by
kannappanr
parent
2d9860e875
commit
b18c0478e7
@@ -29,6 +29,9 @@ import (
|
||||
"encoding/gob"
|
||||
"encoding/hex"
|
||||
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
"github.com/minio/minio/cmd/rest"
|
||||
xnet "github.com/minio/minio/pkg/net"
|
||||
@@ -101,6 +104,15 @@ func toStorageErr(err error) error {
|
||||
case errServerTimeMismatch.Error():
|
||||
return errServerTimeMismatch
|
||||
}
|
||||
if strings.Contains(err.Error(), "Bitrot verification mismatch") {
|
||||
var expected string
|
||||
var received string
|
||||
fmt.Sscanf(err.Error(), "Bitrot verification mismatch - expected %s received %s", &expected, &received)
|
||||
// Go's Sscanf %s scans "," that comes after the expected hash, hence remove it. Providing "," in the format string does not help.
|
||||
expected = strings.TrimSuffix(expected, ",")
|
||||
bitrotErr := hashMismatchError{expected, received}
|
||||
return bitrotErr
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user