From b7fef8f6933d80e71867d8642fba7b393061e385 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 18 Dec 2020 10:34:16 -0800 Subject: [PATCH] fix when a volume server has only hdd volumes --- weed/shell/command_volume_balance.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go index cebe494e7..9faa71cae 100644 --- a/weed/shell/command_volume_balance.go +++ b/weed/shell/command_volume_balance.go @@ -270,6 +270,9 @@ func balanceSelectedVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][]* for i := 0; i < len(nodes)-1; i++ { emptyNode := nodes[i] + if capacityFunc(emptyNode.info) == 0 { + continue + } if !(fullNode.localVolumeRatio(capacityFunc) > idealVolumeRatio && emptyNode.localVolumeNextRatio(capacityFunc) <= idealVolumeRatio) { // no more volume servers with empty slots break