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
parallelize tier move
Chris Lu48f448ee0930
diff --git a/weed/shell/command_volume_tier_move.go b/weed/shell/command_volume_tier_move.goindex bf623b899f..6a28b79709 100644--- a/weed/shell/command_volume_tier_move.go+++ b/weed/shell/command_volume_tier_move.go@@ -133,9 +133,27 @@ func (c *commandVolumeTierMove) doVolumeTierMove(commandEnv *CommandEnv, writerbreak}- if err := c.doMoveOneVolume(commandEnv, writer, vid, toDiskType, locations, sourceVolumeServer, dst); err != nil {- return err+ c.activeServersCond.L.Lock()+ _, isSourceActive := c.activeServers[sourceVolumeServer]+ _, isDestActive := c.activeServers[dst.dataNode.Id]+ for isSourceActive || isDestActive {+ c.activeServersCond.Wait()+ _, isSourceActive = c.activeServers[sourceVolumeServer]+ _, isDestActive = c.activeServers[dst.dataNode.Id]}+ c.activeServers[sourceVolumeServer] = struct{}{}+ c.activeServers[dst.dataNode.Id] = struct{}{}+ c.activeServersCond.L.Unlock()++ go func(dst location) {+ if err := c.doMoveOneVolume(commandEnv, writer, vid, toDiskType, locations, sourceVolumeServer, dst); err != nil {+ fmt.Fprintf(writer, "move volume %d %s => %s: %v", vid, sourceVolumeServer, dst.dataNode.Id, err)+ }+ delete(c.activeServers, sourceVolumeServer)+ delete(c.activeServers, dst.dataNode.Id)+ c.activeServersCond.Signal()+ }(dst)+}}