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
move volume: find target volume server by exiting/max ratio
chrislu98dc1e5c15d0
diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.goindex b6d702e3ab..c9c0033c1a 100644--- a/weed/shell/command_volume_server_evacuate.go+++ b/weed/shell/command_volume_server_evacuate.go@@ -208,17 +208,22 @@ func (c *commandVolumeServerEvacuate) moveAwayOneEcVolume(commandEnv *CommandEnv}func moveAwayOneNormalVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][]*VolumeReplica, vol *master_pb.VolumeInformationMessage, thisNode *Node, otherNodes []*Node, applyChange bool) (hasMoved bool, err error) {- fn := capacityByFreeVolumeCount(types.ToDiskType(vol.DiskType))+ freeVolumeCountfn := capacityByFreeVolumeCount(types.ToDiskType(vol.DiskType))+ maxVolumeCountFn := capacityByMaxVolumeCount(types.ToDiskType(vol.DiskType))for _, n := range otherNodes {n.selectVolumes(func(v *master_pb.VolumeInformationMessage) bool {return v.DiskType == vol.DiskType})}+ // most empty one is in the frontslices.SortFunc(otherNodes, func(a, b *Node) bool {- return a.localVolumeRatio(fn) < b.localVolumeRatio(fn)+ return a.localVolumeRatio(maxVolumeCountFn) < b.localVolumeRatio(maxVolumeCountFn)})for i := 0; i < len(otherNodes); i++ {emptyNode := otherNodes[i]+ if freeVolumeCountfn(emptyNode.info) < 0 {+ continue+ }hasMoved, err = maybeMoveOneVolume(commandEnv, volumeReplicas, thisNode, vol, emptyNode, applyChange)if err != nil {return