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

master
Harshavardhana 8 years ago committed by GitHub
parent afa4c7c3ef
commit 066f64d34a
  1. 2
      cmd/fs-v1-background-append.go
  2. 17
      cmd/object-common.go

@ -33,7 +33,7 @@ var errPartsMissing = errors.New("required parts missing")
var errAppendPartsTimeout = errors.New("appendParts goroutine timeout") var errAppendPartsTimeout = errors.New("appendParts goroutine timeout")
// Timeout value for the appendParts go-routine. // 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 // Holds a map of uploadID->appendParts go-routine
type backgroundAppend struct { type backgroundAppend struct {

@ -194,6 +194,13 @@ func newStorageAPI(ep *url.URL) (storage StorageAPI, err error) {
return newStorageRPC(ep) return newStorageRPC(ep)
} }
var initMetaVolIgnoredErrs = []error{
errVolumeExists,
errDiskNotFound,
errFaultyDisk,
errFaultyRemoteDisk,
}
// Initializes meta volume on all input storage disks. // Initializes meta volume on all input storage disks.
func initMetaVolume(storageDisks []StorageAPI) error { func initMetaVolume(storageDisks []StorageAPI) error {
// This happens for the first time, but keep this here since this // 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`. // Attempt to create `.minio.sys`.
err := disk.MakeVol(minioMetaBucket) err := disk.MakeVol(minioMetaBucket)
if err != nil { if err != nil {
switch err { if !isErrIgnored(err, initMetaVolIgnoredErrs) {
// Ignored errors.
case errVolumeExists, errDiskNotFound, errFaultyDisk:
default:
errs[index] = err errs[index] = err
} }
return return
} }
err = disk.MakeVol(minioMetaTmpBucket) err = disk.MakeVol(minioMetaTmpBucket)
if err != nil { if err != nil {
switch err { if !isErrIgnored(err, initMetaVolIgnoredErrs) {
// Ignored errors.
case errVolumeExists, errDiskNotFound, errFaultyDisk:
default:
errs[index] = err errs[index] = err
} }
return return

Loading…
Cancel
Save