aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_balance.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-11-12 15:36:18 -0800
committerChris Lu <chris.lu@gmail.com>2019-11-12 15:36:18 -0800
commit66acc2c84f2cee21b8a99c2753ec23d782e42a6f (patch)
treed3814ee70aeb1c741af6419830ddcea59bbf430d /weed/shell/command_ec_balance.go
parent40514c53622fded6681f91d1c7d54045a5ef44c8 (diff)
downloadseaweedfs-66acc2c84f2cee21b8a99c2753ec23d782e42a6f.tar.xz
seaweedfs-66acc2c84f2cee21b8a99c2753ec23d782e42a6f.zip
passing in averageShardsPerEcNode instead of expectedTotalEcShards
addressing https://github.com/chrislusf/seaweedfs/issues/1111
Diffstat (limited to 'weed/shell/command_ec_balance.go')
-rw-r--r--weed/shell/command_ec_balance.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go
index 9a70412c5..96599372e 100644
--- a/weed/shell/command_ec_balance.go
+++ b/weed/shell/command_ec_balance.go
@@ -440,10 +440,9 @@ func doBalanceEcRack(ctx context.Context, commandEnv *CommandEnv, ecRack *EcRack
return nil
}
-func pickOneEcNodeAndMoveOneShard(ctx context.Context, commandEnv *CommandEnv, expectedTotalEcShards int, existingLocation *EcNode, collection string, vid needle.VolumeId, shardId erasure_coding.ShardId, possibleDestinationEcNodes []*EcNode, applyBalancing bool) error {
+func pickOneEcNodeAndMoveOneShard(ctx context.Context, commandEnv *CommandEnv, averageShardsPerEcNode int, existingLocation *EcNode, collection string, vid needle.VolumeId, shardId erasure_coding.ShardId, possibleDestinationEcNodes []*EcNode, applyBalancing bool) error {
sortEcNodesByFreeslotsDecending(possibleDestinationEcNodes)
- averageShardsPerEcNode := ceilDivide(expectedTotalEcShards, len(possibleDestinationEcNodes))
for _, destEcNode := range possibleDestinationEcNodes {
if destEcNode.info.Id == existingLocation.info.Id {