Since we do not re-use storageDisks after moving
the connections to object layer we should close them
appropriately otherwise we have a lot of connection
leaks and these can compound as the time goes by.
This PR also refactors the initialization code to
re-use storageDisks for given set of endpoints until
we have confirmed a valid reference format.
master
Harshavardhana7 years agocommitted byNitish Tiwari
returnfmt.Errorf("%s format error: %s",endpoints[i],err)
}
}
iflen(format.XL.Sets)!=setCount{
returnfmt.Errorf("Current backend format is inconsistent with input args (%s), Expected set count %d, got %d",endpoints,len(format.XL.Sets),setCount)
}
iflen(format.XL.Sets[0])!=drivesPerSet{
returnfmt.Errorf("Current backend format is inconsistent with input args (%s), Expected drive count per set %d, got %d",endpoints,len(format.XL.Sets[0]),drivesPerSet)
}
returnnil
}
// Following error message is added to fix a regression in release
// RELEASE.2018-03-16T22-52-12Z after migrating v1 to v2 to v3. This
// migration failed to capture '.This' field properly which indicates
// the disk UUID association. Below error message is returned when
// we see this situation in format.json, for more info refer
// https://github.com/minio/minio/issues/5667
varerrXLV3ThisEmpty=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
// 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.
returnnil,fmt.Errorf("%s format error: %s",endpoints[i],err)
}
}
iflen(format.XL.Sets)!=globalXLSetCount{
returnnil,fmt.Errorf("Current backend format is inconsistent with input args (%s), Expected set count %d, got %d",endpoints,len(format.XL.Sets),globalXLSetCount)
}
iflen(format.XL.Sets[0])!=globalXLSetDriveCount{
returnnil,fmt.Errorf("Current backend format is inconsistent with input args (%s), Expected drive count per set %d, got %d",endpoints,len(format.XL.Sets[0]),globalXLSetDriveCount)
}
returnformat,nil
}
console.Printf("Waiting for a minimum of %d disks to come online (elapsed %s)\n",len(endpoints)/2,getElapsedTime())
returnformat,nil
case<-globalOSSignalCh:
returnnil,fmt.Errorf("Initializing data volumes gracefully stopped")