xl/fs: Fix initializing meta volume bug.

master
Harshavardhana 8 years ago
parent fd1f09a66c
commit 46a6fde813
  1. 5
      cmd/fs-v1.go
  2. 6
      cmd/object-common.go
  3. 5
      cmd/xl-v1.go

@ -60,6 +60,11 @@ func newFSObjects(storage StorageAPI) (ObjectLayer, error) {
return nil, fmt.Errorf("Unable to recognize backend format, %s", err) return nil, fmt.Errorf("Unable to recognize backend format, %s", err)
} }
// Initialize meta volume, if volume already exists ignores it.
if err = initMetaVolume([]StorageAPI{storage}); err != nil {
return nil, fmt.Errorf("Unable to initialize '.minio.sys' meta volume, %s", err)
}
// Initialize fs objects. // Initialize fs objects.
fs := fsObjects{ fs := fsObjects{
storage: storage, storage: storage,

@ -211,23 +211,23 @@ func initMetaVolume(storageDisks []StorageAPI) error {
if err != nil { if err != nil {
if !isErrIgnored(err, initMetaVolIgnoredErrs...) { if !isErrIgnored(err, initMetaVolIgnoredErrs...) {
errs[index] = err errs[index] = err
}
return return
} }
}
err = disk.MakeVol(minioMetaTmpBucket) err = disk.MakeVol(minioMetaTmpBucket)
if err != nil { if err != nil {
if !isErrIgnored(err, initMetaVolIgnoredErrs...) { if !isErrIgnored(err, initMetaVolIgnoredErrs...) {
errs[index] = err errs[index] = err
}
return return
} }
}
err = disk.MakeVol(minioMetaMultipartBucket) err = disk.MakeVol(minioMetaMultipartBucket)
if err != nil { if err != nil {
if !isErrIgnored(err, initMetaVolIgnoredErrs...) { if !isErrIgnored(err, initMetaVolIgnoredErrs...) {
errs[index] = err errs[index] = err
}
return return
} }
}
}(index, disk) }(index, disk)
} }

@ -112,6 +112,11 @@ func newXLObjects(storageDisks []StorageAPI) (ObjectLayer, error) {
objCacheEnabled: !objCacheDisabled, objCacheEnabled: !objCacheDisabled,
} }
// Initialize meta volume, if volume already exists ignores it.
if err = initMetaVolume(storageDisks); err != nil {
return nil, fmt.Errorf("Unable to initialize '.minio.sys' meta volume, %s", err)
}
// Figure out read and write quorum based on number of storage disks. // Figure out read and write quorum based on number of storage disks.
// READ and WRITE quorum is always set to (N/2) number of disks. // READ and WRITE quorum is always set to (N/2) number of disks.
xl.readQuorum = readQuorum xl.readQuorum = readQuorum

Loading…
Cancel
Save