mount ec shards correctly (#7079)

This commit is contained in:
Chris Lu
2025-08-03 23:10:28 -07:00
committed by GitHub
parent 513ac58504
commit 365d03ff32

View File

@@ -202,8 +202,8 @@ func doEcEncode(commandEnv *CommandEnv, collection string, volumeIds []needle.Vo
} }
ewg.Reset() ewg.Reset()
for _, vid := range volumeIds { for i, vid := range volumeIds {
target := locations[vid][0] target := locations[vid][i%len(locations[vid])]
ewg.Add(func() error { ewg.Add(func() error {
if err := mountEcShards(commandEnv.option.GrpcDialOption, collection, vid, target.ServerAddress(), shardIds); err != nil { 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) return fmt.Errorf("mount ec shards for volume %d on %s: %v", vid, target.Url, err)