bootup: MetaVolume init should use isErrIngored helper. (#3303)

This commit is contained in:
Harshavardhana 2016-11-21 01:46:55 -08:00 committed by GitHub
parent afa4c7c3ef
commit 066f64d34a
2 changed files with 10 additions and 9 deletions

View File

@ -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 {

View File

@ -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