aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-10 11:37:12 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-10 11:37:12 -0700
commit0526db12e2622134845fe0733148904bb04fdbf0 (patch)
treeddb4eea210f5ccc08350df3921643080bfa11db3
parente50a5b8e285db031bce3bfaf336df20fbd9be8ca (diff)
downloadseaweedfs-0526db12e2622134845fe0733148904bb04fdbf0.tar.xz
seaweedfs-0526db12e2622134845fe0733148904bb04fdbf0.zip
do not treat read only volumes differently
-rw-r--r--weed/shell/command_volume_balance.go18
1 files changed, 1 insertions, 17 deletions
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go
index 116555e00..8233affa7 100644
--- a/weed/shell/command_volume_balance.go
+++ b/weed/shell/command_volume_balance.go
@@ -120,7 +120,6 @@ func balanceVolumeServers(commandEnv *CommandEnv, diskTypes []types.DiskType, vo
func balanceVolumeServersByDiskType(commandEnv *CommandEnv, diskType types.DiskType, volumeReplicas map[uint32][]*VolumeReplica, nodes []*Node, volumeSizeLimit uint64, collection string, applyBalancing bool) error {
- // balance read only volumes
for _, n := range nodes {
n.selectVolumes(func(v *master_pb.VolumeInformationMessage) bool {
if collection != "ALL_COLLECTIONS" {
@@ -128,22 +127,7 @@ func balanceVolumeServersByDiskType(commandEnv *CommandEnv, diskType types.DiskT
return false
}
}
- return v.DiskType == string(diskType) && (v.ReadOnly || v.Size >= volumeSizeLimit)
- })
- }
- if err := balanceSelectedVolume(commandEnv, diskType, volumeReplicas, nodes, capacityByMaxVolumeCount(diskType), sortReadOnlyVolumes, applyBalancing); err != nil {
- return err
- }
-
- // balance writable volumes
- for _, n := range nodes {
- n.selectVolumes(func(v *master_pb.VolumeInformationMessage) bool {
- if collection != "ALL_COLLECTIONS" {
- if v.Collection != collection {
- return false
- }
- }
- return v.DiskType == string(diskType) && (!v.ReadOnly && v.Size < volumeSizeLimit)
+ return v.DiskType == string(diskType)
})
}
if err := balanceSelectedVolume(commandEnv, diskType, volumeReplicas, nodes, capacityByMaxVolumeCount(diskType), sortWritableVolumes, applyBalancing); err != nil {