Skip to content

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.

mount ec shards correctly (#7079)

Chris Lu365d03ff3247
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go
index da96492ae2..d8891b28a4 100644
--- a/weed/shell/command_ec_encode.go
+++ b/weed/shell/command_ec_encode.go
@@ -202,8 +202,8 @@ func doEcEncode(commandEnv *CommandEnv, collection string, volumeIds []needle.Vo
}
ewg.Reset()
- for _, vid := range volumeIds {
- target := locations[vid][0]
+ for i, vid := range volumeIds {
+ target := locations[vid][i%len(locations[vid])]
ewg.Add(func() error {
if err := mountEcShards(commandEnv.option.GrpcDialOption, collection, vid, target.ServerAddress(), shardIds); err != nil {
return fmt.Errorf("mount ec shards for volume %d on %s: %v", vid, target.Url, err)