xl: Avoid empty endpoints (#13299)

An endpoint can be empty when a disk is offline or something 
wrong with it. Avoid it by filling erasureSets.endpointStrings 
with values from arguments.
This commit is contained in:
Anis Elleuch 2021-09-25 18:51:03 +01:00 committed by GitHub
parent a5923a5d51
commit 68a2d6fc40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -349,6 +349,12 @@ func newErasureSets(ctx context.Context, endpoints Endpoints, storageDisks []Sto
endpointStrings := make([]string, len(endpoints))
// Fill endpointString with the same order of endpoints passed as
// arguments but it will be reordered later according to disks order
for i, endpoint := range endpoints {
endpointStrings[i] = endpoint.String()
}
// Initialize the erasure sets instance.
s := &erasureSets{
sets: make([]*erasureObjects, setCount),