@ -228,7 +228,7 @@ func isServerResolvable(endpoint Endpoint) error {
// connect to list of endpoints and load all Erasure disk formats, validate the formats are correct
// connect to list of endpoints and load all Erasure 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 , poolCount , setCount , setDriveCount int , deploymentID string ) ( storageDisks [ ] StorageAPI , format * formatErasureV3 , err error ) {
func connectLoadInitFormats ( retryCount int , firstDisk bool , endpoints Endpoints , poolCount , setCount , setDriveCount int , deploymentID , distributionAlgo string ) ( storageDisks [ ] StorageAPI , format * formatErasureV3 , err error ) {
// Initialize all storage disks
// Initialize all storage disks
storageDisks , errs := initStorageDisksWithErrors ( endpoints )
storageDisks , errs := initStorageDisksWithErrors ( endpoints )
@ -276,7 +276,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints,
humanize . Ordinal ( poolCount ) , setCount , setDriveCount )
humanize . Ordinal ( poolCount ) , setCount , setDriveCount )
// Initialize erasure code format on disks
// Initialize erasure code format on disks
format , err = initFormatErasure ( GlobalContext , storageDisks , setCount , setDriveCount , deploymentID , sErrs )
format , err = initFormatErasure ( GlobalContext , storageDisks , setCount , setDriveCount , deploymentID , distributionAlgo , sErrs )
if err != nil {
if err != nil {
return nil , nil , err
return nil , nil , err
}
}
@ -345,7 +345,7 @@ func connectLoadInitFormats(retryCount int, firstDisk bool, endpoints Endpoints,
}
}
// Format disks before initialization of object layer.
// Format disks before initialization of object layer.
func waitForFormatErasure ( firstDisk bool , endpoints Endpoints , poolCount , setCount , setDriveCount int , deploymentID string ) ( [ ] StorageAPI , * formatErasureV3 , error ) {
func waitForFormatErasure ( firstDisk bool , endpoints Endpoints , poolCount , setCount , setDriveCount int , deploymentID , distributionAlgo string ) ( [ ] StorageAPI , * formatErasureV3 , error ) {
if len ( endpoints ) == 0 || setCount == 0 || setDriveCount == 0 {
if len ( endpoints ) == 0 || setCount == 0 || setDriveCount == 0 {
return nil , nil , errInvalidArgument
return nil , nil , errInvalidArgument
}
}
@ -372,7 +372,7 @@ func waitForFormatErasure(firstDisk bool, endpoints Endpoints, poolCount, setCou
for {
for {
select {
select {
case <- ticker . C :
case <- ticker . C :
storageDisks , format , err := connectLoadInitFormats ( tries , firstDisk , endpoints , poolCount , setCount , setDriveCount , deploymentID )
storageDisks , format , err := connectLoadInitFormats ( tries , firstDisk , endpoints , poolCount , setCount , setDriveCount , deploymentID , distributionAlgo )
if err != nil {
if err != nil {
tries ++
tries ++
switch err {
switch err {