fix volume balance bug

This commit is contained in:
Chris Lu
2019-06-03 00:13:31 -07:00
parent 9ce6b949bf
commit 55be09996d
2 changed files with 10 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"io"
"math"
"os"
"sort"
"time"
@@ -186,7 +187,7 @@ func balanceSelectedVolume(commandEnv *commandEnv, nodes []*Node, sortCandidates
selectedVolumeCount += len(dn.selectedVolumes)
}
idealSelectedVolumes := selectedVolumeCount / len(nodes)
idealSelectedVolumes := int(math.Ceil(float64(selectedVolumeCount) / float64(len(nodes))))
hasMove := true