Preserve same deploymentID on all zones (#8542)

This commit is contained in:
Harshavardhana
2019-11-20 02:09:30 -08:00
committed by Nitish Tiwari
parent 347b29d059
commit 8392d2f510
8 changed files with 33 additions and 21 deletions

View File

@@ -208,7 +208,7 @@ func initSafeModeInit(buckets []BucketInfo) (err error) {
return err
}
defer func() {
defer func(objLock RWLocker) {
objLock.Unlock()
if err != nil {
@@ -226,7 +226,7 @@ func initSafeModeInit(buckets []BucketInfo) (err error) {
// not proceeding waiting for admin action.
handleSignals()
}
}()
}(objLock)
// Calls New() for all sub-systems.
newAllSubsystems()
@@ -437,13 +437,17 @@ func newObjectLayer(endpointZones EndpointZones) (newObject ObjectLayer, err err
return NewFSObjectLayer(endpointZones[0].Endpoints[0].Path)
}
var formats []*formatXLV3
for _, ep := range endpointZones {
format, err := waitForFormatXL(ep.Endpoints[0].IsLocal, ep.Endpoints, ep.SetCount, ep.DrivesPerSet)
var formats = make([]*formatXLV3, len(endpointZones))
var deploymentID string
for i, ep := range endpointZones {
formats[i], err = waitForFormatXL(ep.Endpoints[0].IsLocal, ep.Endpoints,
ep.SetCount, ep.DrivesPerSet, deploymentID)
if err != nil {
return nil, err
}
formats = append(formats, format)
if deploymentID == "" {
deploymentID = formats[i].ID
}
}
return newXLZones(endpointZones, formats)
}