calculate automatic node based symmetry (#9446)

it is possible in many screnarios that even
if the divisible value is optimal, we may
end up with uneven distribution due to number
of nodes present in the configuration.

added code allow for affinity towards various
ellipses to figure out optimal value across
ellipses such that we can always reach a
symmetric value automatically.

Fixes #9416
This commit is contained in:
Harshavardhana
2020-04-27 14:39:57 -07:00
committed by GitHub
parent 97d952e61c
commit bc61417284
8 changed files with 145 additions and 34 deletions
+4 -1
View File
@@ -293,7 +293,7 @@ func (s *xlSets) GetDisks(setIndex int) func() []StorageAPI {
const defaultMonitorConnectEndpointInterval = time.Second * 10 // Set to 10 secs.
// Initialize new set of erasure coded sets.
func newXLSets(ctx context.Context, endpoints Endpoints, storageDisks []StorageAPI, format *formatXLV3, setCount int, drivesPerSet int) (*xlSets, error) {
func newXLSets(ctx context.Context, endpoints Endpoints, storageDisks []StorageAPI, format *formatXLV3) (*xlSets, error) {
endpointStrings := make([]string, len(endpoints))
for i, endpoint := range endpoints {
if endpoint.IsLocal {
@@ -303,6 +303,9 @@ func newXLSets(ctx context.Context, endpoints Endpoints, storageDisks []StorageA
}
}
setCount := len(format.XL.Sets)
drivesPerSet := len(format.XL.Sets[0])
// Initialize the XL sets instance.
s := &xlSets{
sets: make([]*xlObjects, setCount),