From 68a2d6fc40323cc2a0be0f706ee703fab6378839 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Sat, 25 Sep 2021 18:51:03 +0100 Subject: [PATCH] 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. --- cmd/erasure-sets.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/erasure-sets.go b/cmd/erasure-sets.go index d2a2c4a5c..fe6a015d2 100644 --- a/cmd/erasure-sets.go +++ b/cmd/erasure-sets.go @@ -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),