|
|
@ -174,7 +174,7 @@ var errXLV3ThisEmpty = fmt.Errorf("XL format version 3 has This field empty") |
|
|
|
// 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, setCount, drivesPerSet int) (*formatXLV3, error) { |
|
|
|
func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, setCount, drivesPerSet int, deploymentID string) (*formatXLV3, error) { |
|
|
|
// Initialize all storage disks
|
|
|
|
// Initialize all storage disks
|
|
|
|
storageDisks, errs := initStorageDisksWithErrors(endpoints) |
|
|
|
storageDisks, errs := initStorageDisksWithErrors(endpoints) |
|
|
|
defer closeStorageDisks(storageDisks) |
|
|
|
defer closeStorageDisks(storageDisks) |
|
|
@ -216,7 +216,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, |
|
|
|
// All disks report unformatted we should initialized everyone.
|
|
|
|
// All disks report unformatted we should initialized everyone.
|
|
|
|
if shouldInitXLDisks(sErrs) && firstDisk { |
|
|
|
if shouldInitXLDisks(sErrs) && firstDisk { |
|
|
|
// Initialize erasure code format on disks
|
|
|
|
// Initialize erasure code format on disks
|
|
|
|
format, err := initFormatXL(context.Background(), storageDisks, setCount, drivesPerSet) |
|
|
|
format, err := initFormatXL(context.Background(), storageDisks, setCount, drivesPerSet, deploymentID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -286,7 +286,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Format disks before initialization of object layer.
|
|
|
|
// Format disks before initialization of object layer.
|
|
|
|
func waitForFormatXL(firstDisk bool, endpoints Endpoints, setCount, disksPerSet int) (format *formatXLV3, err error) { |
|
|
|
func waitForFormatXL(firstDisk bool, endpoints Endpoints, setCount, disksPerSet int, deploymentID string) (format *formatXLV3, err error) { |
|
|
|
if len(endpoints) == 0 || setCount == 0 || disksPerSet == 0 { |
|
|
|
if len(endpoints) == 0 || setCount == 0 || disksPerSet == 0 { |
|
|
|
return nil, errInvalidArgument |
|
|
|
return nil, errInvalidArgument |
|
|
|
} |
|
|
|
} |
|
|
@ -318,7 +318,7 @@ func waitForFormatXL(firstDisk bool, endpoints Endpoints, setCount, disksPerSet |
|
|
|
for { |
|
|
|
for { |
|
|
|
select { |
|
|
|
select { |
|
|
|
case retryCount := <-retryTimerCh: |
|
|
|
case retryCount := <-retryTimerCh: |
|
|
|
format, err := connectLoadInitFormats(retryCount, firstDisk, endpoints, setCount, disksPerSet) |
|
|
|
format, err := connectLoadInitFormats(retryCount, firstDisk, endpoints, setCount, disksPerSet, deploymentID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
switch err { |
|
|
|
switch err { |
|
|
|
case errNotFirstDisk: |
|
|
|
case errNotFirstDisk: |
|
|
|