diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-06-03 00:13:31 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-06-03 00:13:31 -0700 |
| commit | 55be09996d8f82e461e1c464db82707c982b2b57 (patch) | |
| tree | bd5564d5460ff76b610650e9979019bf2afcfb99 /weed/shell | |
| parent | 9ce6b949bf778e16cbf0f2e73ad508c65c3c8fc3 (diff) | |
| download | seaweedfs-55be09996d8f82e461e1c464db82707c982b2b57.tar.xz seaweedfs-55be09996d8f82e461e1c464db82707c982b2b57.zip | |
fix volume balance bug
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_volume_balance.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go index f440dc5d2..2a5731333 100644 --- a/weed/shell/command_volume_balance.go +++ b/weed/shell/command_volume_balance.go @@ -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 |
