diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-18 10:34:16 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-18 10:34:16 -0800 |
| commit | b7fef8f6933d80e71867d8642fba7b393061e385 (patch) | |
| tree | ebe740eabe64446fcfbd4d1189de40d1b90eb907 /weed/shell/command_volume_balance.go | |
| parent | 9abf016af14ef632e9ecdfa09a16323ca2c6417f (diff) | |
| download | seaweedfs-b7fef8f6933d80e71867d8642fba7b393061e385.tar.xz seaweedfs-b7fef8f6933d80e71867d8642fba7b393061e385.zip | |
fix when a volume server has only hdd volumes
Diffstat (limited to 'weed/shell/command_volume_balance.go')
| -rw-r--r-- | weed/shell/command_volume_balance.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 |
