|
|
@ -221,10 +221,16 @@ func IsServerResolvable(endpoint Endpoint) error { |
|
|
|
// connect to list of endpoints and load all XL disk formats, validate the formats are correct
|
|
|
|
// connect to list of endpoints and load all XL disk formats, validate the formats are correct
|
|
|
|
// and are in quorum, if no formats are found attempt to initialize all of them for the first
|
|
|
|
// and are in quorum, if no formats are found attempt to initialize all of them for the first
|
|
|
|
// time. additionally make sure to close all the disks used in this attempt.
|
|
|
|
// time. additionally make sure to close all the disks used in this attempt.
|
|
|
|
func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, zoneCount, setCount, drivesPerSet int, deploymentID string) ([]StorageAPI, *formatXLV3, error) { |
|
|
|
func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, zoneCount, setCount, drivesPerSet int, deploymentID string) (storageDisks []StorageAPI, format *formatXLV3, err error) { |
|
|
|
// Initialize all storage disks
|
|
|
|
// Initialize all storage disks
|
|
|
|
storageDisks, errs := initStorageDisksWithErrors(endpoints) |
|
|
|
storageDisks, errs := initStorageDisksWithErrors(endpoints) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defer func(storageDisks []StorageAPI) { |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
closeStorageDisks(storageDisks) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}(storageDisks) |
|
|
|
|
|
|
|
|
|
|
|
for i, err := range errs { |
|
|
|
for i, err := range errs { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if err != errDiskNotFound { |
|
|
|
if err != errDiskNotFound { |
|
|
@ -256,7 +262,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, |
|
|
|
// most part unless one of the formats is not consistent
|
|
|
|
// most part unless one of the formats is not consistent
|
|
|
|
// with expected XL format. For example if a user is
|
|
|
|
// with expected XL format. For example if a user is
|
|
|
|
// trying to pool FS backend into an XL set.
|
|
|
|
// trying to pool FS backend into an XL set.
|
|
|
|
if err := checkFormatXLValues(formatConfigs, drivesPerSet); err != nil { |
|
|
|
if err = checkFormatXLValues(formatConfigs, drivesPerSet); err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -266,7 +272,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, |
|
|
|
zoneCount, setCount, drivesPerSet) |
|
|
|
zoneCount, setCount, drivesPerSet) |
|
|
|
|
|
|
|
|
|
|
|
// Initialize erasure code format on disks
|
|
|
|
// Initialize erasure code format on disks
|
|
|
|
format, err := initFormatXL(context.Background(), storageDisks, setCount, drivesPerSet, deploymentID) |
|
|
|
format, err = initFormatXL(context.Background(), storageDisks, setCount, drivesPerSet, deploymentID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -293,7 +299,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, |
|
|
|
// This migration failed to capture '.This' field properly which indicates
|
|
|
|
// This migration failed to capture '.This' field properly which indicates
|
|
|
|
// the disk UUID association. Below function is called to handle and fix
|
|
|
|
// the disk UUID association. Below function is called to handle and fix
|
|
|
|
// this regression, for more info refer https://github.com/minio/minio/issues/5667
|
|
|
|
// this regression, for more info refer https://github.com/minio/minio/issues/5667
|
|
|
|
if err := fixFormatXLV3(storageDisks, endpoints, formatConfigs); err != nil { |
|
|
|
if err = fixFormatXLV3(storageDisks, endpoints, formatConfigs); err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -302,7 +308,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, |
|
|
|
return nil, nil, errXLV3ThisEmpty |
|
|
|
return nil, nil, errXLV3ThisEmpty |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
format, err := getFormatXLInQuorum(formatConfigs) |
|
|
|
format, err = getFormatXLInQuorum(formatConfigs) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, nil, err |
|
|
|
return nil, nil, err |
|
|
|
} |
|
|
|
} |
|
|
|