distributed-XL: Support to run one minio process per export even on the same machine. (#2999)

fixes #2983
This commit is contained in:
Krishna Srinivas
2016-10-19 01:19:24 +05:30
committed by Harshavardhana
parent 41f9ab1c69
commit 32c3a558e9
29 changed files with 688 additions and 416 deletions
+15 -15
View File
@@ -20,7 +20,6 @@ import (
"time"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-go/pkg/set"
)
// Channel where minioctl heal handler would notify if it were successful. This
@@ -250,34 +249,35 @@ func retryFormattingDisks(firstDisk bool, firstEndpoint string, storageDisks []S
}
// Initialize storage disks based on input arguments.
func initStorageDisks(disks, ignoredDisks []string) ([]StorageAPI, error) {
func initStorageDisks(endPoints, ignoredEndPoints []storageEndPoint) ([]StorageAPI, error) {
// Single disk means we will use FS backend.
if len(disks) == 1 {
storage, err := newStorageAPI(disks[0])
if len(endPoints) == 1 {
storage, err := newStorageAPI(endPoints[0])
if err != nil && err != errDiskNotFound {
return nil, err
}
return []StorageAPI{storage}, nil
} // Otherwise proceed with XL setup.
if err := checkSufficientDisks(disks); err != nil {
return nil, err
}
disksSet := set.NewStringSet()
if len(ignoredDisks) > 0 {
disksSet = set.CreateStringSet(ignoredDisks...)
}
// Otherwise proceed with XL setup.
// Bootstrap disks.
storageDisks := make([]StorageAPI, len(disks))
for index, disk := range disks {
storageDisks := make([]StorageAPI, len(endPoints))
for index, ep := range endPoints {
// Check if disk is ignored.
if disksSet.Contains(disk) {
ignored := false
for _, iep := range ignoredEndPoints {
if ep == iep {
ignored = true
break
}
}
if ignored {
// Set this situation as disk not found.
storageDisks[index] = nil
continue
}
// Intentionally ignore disk not found errors. XL is designed
// to handle these errors internally.
storage, err := newStorageAPI(disk)
storage, err := newStorageAPI(ep)
if err != nil && err != errDiskNotFound {
return nil, err
}