diff --git a/cmd/endpoint-ellipses.go b/cmd/endpoint-ellipses.go index b7a9f2486..92e8b224b 100644 --- a/cmd/endpoint-ellipses.go +++ b/cmd/endpoint-ellipses.go @@ -181,6 +181,11 @@ func getSetIndexes(args []string, totalSizes []uint64, customSetDriveCount uint6 // Returns possible set counts with symmetry. setCounts = possibleSetCountsWithSymmetry(setCounts, argPatterns) + if len(setCounts) == 0 { + msg := fmt.Sprintf("No symmetric distribution detected with input endpoints provided %s, disks %d cannot be spread symmetrically by any supported erasure set sizes %d", args, commonSize, setSizes) + return nil, config.ErrInvalidNumberOfErasureEndpoints(nil).Msg(msg) + } + // Final set size with all the symmetry accounted for. setSize = commonSetDriveCount(commonSize, setCounts) } diff --git a/cmd/endpoint-ellipses_test.go b/cmd/endpoint-ellipses_test.go index f73d776a4..14cf07f71 100644 --- a/cmd/endpoint-ellipses_test.go +++ b/cmd/endpoint-ellipses_test.go @@ -211,6 +211,12 @@ func TestGetSetIndexes(t *testing.T) { nil, false, }, + { + []string{"data{1...17}/export{1...52}"}, + []uint64{14144}, + nil, + false, + }, // Valid inputs. { []string{"data{1...27}"}, @@ -272,6 +278,12 @@ func TestGetSetIndexes(t *testing.T) { [][]uint64{{10}, {10}, {10}}, true, }, + { + []string{"data{1...16}/export{1...52}"}, + []uint64{832}, + [][]uint64{{16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}}, + true, + }, } for _, testCase := range testCases {