SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
volume.balance: balance read only volumes first
Chris Lu6de786185d6c
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.goindex ad7da0e441..06a5ebc925 100644--- a/weed/shell/command_volume_balance.go+++ b/weed/shell/command_volume_balance.go@@ -120,7 +120,7 @@ func balanceVolumeServers(commandEnv *CommandEnv, diskTypes []types.DiskType, vofunc balanceVolumeServersByDiskType(commandEnv *CommandEnv, diskType types.DiskType, volumeReplicas map[uint32][]*VolumeReplica, nodes []*Node, volumeSizeLimit uint64, collection string, applyBalancing bool) error {- // balance writable volumes+ // balance readable volumesfor _, n := range nodes {n.selectVolumes(func(v *master_pb.VolumeInformationMessage) bool {if collection != "ALL_COLLECTIONS" {@@ -128,14 +128,14 @@ func balanceVolumeServersByDiskType(commandEnv *CommandEnv, diskType types.DiskTreturn false}}- return v.DiskType == string(diskType) && (!v.ReadOnly && v.Size < volumeSizeLimit)+ return v.DiskType == string(diskType) && (v.ReadOnly || v.Size >= volumeSizeLimit)})}- if err := balanceSelectedVolume(commandEnv, volumeReplicas, nodes, capacityByMaxVolumeCount(diskType), sortWritableVolumes, applyBalancing); err != nil {+ if err := balanceSelectedVolume(commandEnv, volumeReplicas, nodes, capacityByMaxVolumeCount(diskType), sortReadOnlyVolumes, applyBalancing); err != nil {return err}- // balance readable volumes+ // balance writable volumesfor _, n := range nodes {n.selectVolumes(func(v *master_pb.VolumeInformationMessage) bool {if collection != "ALL_COLLECTIONS" {@@ -143,10 +143,10 @@ func balanceVolumeServersByDiskType(commandEnv *CommandEnv, diskType types.DiskTreturn false}}- return v.DiskType == string(diskType) && (v.ReadOnly || v.Size >= volumeSizeLimit)+ return v.DiskType == string(diskType) && (!v.ReadOnly && v.Size < volumeSizeLimit)})}- if err := balanceSelectedVolume(commandEnv, volumeReplicas, nodes, capacityByMaxVolumeCount(diskType), sortReadOnlyVolumes, applyBalancing); err != nil {+ if err := balanceSelectedVolume(commandEnv, volumeReplicas, nodes, capacityByMaxVolumeCount(diskType), sortWritableVolumes, applyBalancing); err != nil {return err}