mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
bootup: MetaVolume init should use isErrIngored helper. (#3303)
This commit is contained in:
parent
afa4c7c3ef
commit
066f64d34a
@ -33,7 +33,7 @@ var errPartsMissing = errors.New("required parts missing")
|
||||
var errAppendPartsTimeout = errors.New("appendParts goroutine timeout")
|
||||
|
||||
// Timeout value for the appendParts go-routine.
|
||||
var appendPartsTimeout = 24 * 60 * 60 * time.Second
|
||||
var appendPartsTimeout = 24 * 60 * 60 * time.Second // 24 hours.
|
||||
|
||||
// Holds a map of uploadID->appendParts go-routine
|
||||
type backgroundAppend struct {
|
||||
|
@ -194,6 +194,13 @@ func newStorageAPI(ep *url.URL) (storage StorageAPI, err error) {
|
||||
return newStorageRPC(ep)
|
||||
}
|
||||
|
||||
var initMetaVolIgnoredErrs = []error{
|
||||
errVolumeExists,
|
||||
errDiskNotFound,
|
||||
errFaultyDisk,
|
||||
errFaultyRemoteDisk,
|
||||
}
|
||||
|
||||
// Initializes meta volume on all input storage disks.
|
||||
func initMetaVolume(storageDisks []StorageAPI) error {
|
||||
// This happens for the first time, but keep this here since this
|
||||
@ -218,20 +225,14 @@ func initMetaVolume(storageDisks []StorageAPI) error {
|
||||
// Attempt to create `.minio.sys`.
|
||||
err := disk.MakeVol(minioMetaBucket)
|
||||
if err != nil {
|
||||
switch err {
|
||||
// Ignored errors.
|
||||
case errVolumeExists, errDiskNotFound, errFaultyDisk:
|
||||
default:
|
||||
if !isErrIgnored(err, initMetaVolIgnoredErrs) {
|
||||
errs[index] = err
|
||||
}
|
||||
return
|
||||
}
|
||||
err = disk.MakeVol(minioMetaTmpBucket)
|
||||
if err != nil {
|
||||
switch err {
|
||||
// Ignored errors.
|
||||
case errVolumeExists, errDiskNotFound, errFaultyDisk:
|
||||
default:
|
||||
if !isErrIgnored(err, initMetaVolIgnoredErrs) {
|
||||
errs[index] = err
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user