Avoid pointer based copy, instead use Clone() (#8547)

This PR adds functional test to test expanded
cluster syntax.
This commit is contained in:
Harshavardhana
2019-11-21 04:24:51 -08:00
committed by Nitish Tiwari
parent 9565641b9b
commit 4e9de58675
18 changed files with 198 additions and 165 deletions

View File

@@ -50,15 +50,30 @@ func (z *xlZones) quickHealBuckets(ctx context.Context) {
}
}
// Initialize new zone of erasure codes.
func newXLZones(endpointZones EndpointZones, formats []*formatXLV3) (ObjectLayer, error) {
z := &xlZones{}
// Initialize new zone of erasure sets.
func newXLZones(endpointZones EndpointZones) (ObjectLayer, error) {
var (
deploymentID string
err error
formats = make([]*formatXLV3, len(endpointZones))
z = &xlZones{zones: make([]*xlSets, len(endpointZones))}
)
for i, ep := range endpointZones {
sets, err := newXLSets(ep.Endpoints, formats[i], ep.SetCount, ep.DrivesPerSet)
formats[i], err = waitForFormatXL(endpointZones.First(), ep.Endpoints,
ep.SetCount, ep.DrivesPerSet, deploymentID)
if err != nil {
return nil, err
}
if deploymentID == "" {
deploymentID = formats[i].ID
}
}
for i, ep := range endpointZones {
z.zones[i], err = newXLSets(ep.Endpoints, formats[i], ep.SetCount, ep.DrivesPerSet)
if err != nil {
return nil, err
}
z.zones = append(z.zones, sets)
}
z.quickHealBuckets(context.Background())
return z, nil