diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-11-10 12:06:41 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-11-10 12:06:41 -0800 |
| commit | 9c2f3b1b0f2b7e4617975edde4f4872ff6418641 (patch) | |
| tree | 45c8ef89274bc00db60430081a08cb6e65031d54 /weed/shell/command_ec_balance.go | |
| parent | e6ab75972f4327a12bf5ce517cde8926247f384f (diff) | |
| download | seaweedfs-9c2f3b1b0f2b7e4617975edde4f4872ff6418641.tar.xz seaweedfs-9c2f3b1b0f2b7e4617975edde4f4872ff6418641.zip | |
fix rack_not_found case
fix rack_not_found in https://github.com/chrislusf/seaweedfs/issues/1111
Diffstat (limited to 'weed/shell/command_ec_balance.go')
| -rw-r--r-- | weed/shell/command_ec_balance.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go index 47ae7bad3..8bf993f4a 100644 --- a/weed/shell/command_ec_balance.go +++ b/weed/shell/command_ec_balance.go @@ -266,6 +266,10 @@ func doBalanceEcShardsAcrossRacks(ctx context.Context, commandEnv *CommandEnv, c for shardId, ecNode := range ecShardsToMove { rackId := pickOneRack(racks, rackToShardCount, averageShardsPerEcRack) + if rackId == "" { + fmt.Printf("ec shard %d.%d at %s can not find a destination rack\n", vid, shardId, ecNode.info.Id) + continue + } var possibleDestinationEcNodes []*EcNode for _, n := range racks[rackId].ecNodes { possibleDestinationEcNodes = append(possibleDestinationEcNodes, n) |
