aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2024-12-20 02:46:11 +0100
committerGitHub <noreply@github.com>2024-12-19 17:46:11 -0800
commit4d91ec359b3a04bce43c422e8ed1bdc397398d20 (patch)
tree9422be67930570ab529fb392779f880c448f8c41
parentba0707af641e41ba3cbed2b533ed2432d21295ba (diff)
downloadseaweedfs-4d91ec359b3a04bce43c422e8ed1bdc397398d20.tar.xz
seaweedfs-4d91ec359b3a04bce43c422e8ed1bdc397398d20.zip
Fix volume replica parallelization within `ec.encode`. (#6377)
See 826edd5d.
-rw-r--r--weed/shell/command_ec_encode.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go
index 2c1625ea7..829b93a3d 100644
--- a/weed/shell/command_ec_encode.go
+++ b/weed/shell/command_ec_encode.go
@@ -119,7 +119,7 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
// encode all requested volumes...
for _, vid := range volumeIds {
- if err = doEcEncode(commandEnv, *collection, vid, *parallelize); err != nil {
+ if err = doEcEncode(commandEnv, *collection, vid, *maxParallelization); err != nil {
return fmt.Errorf("ec encode for volume %d: %v", vid, err)
}
}
@@ -131,7 +131,7 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
return nil
}
-func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId, parallelize bool) error {
+func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId, maxParallelization int) error {
if !commandEnv.isLocked() {
return fmt.Errorf("lock is lost")
}
@@ -143,9 +143,7 @@ func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId,
}
// mark the volume as readonly
- ewg := ErrorWaitGroup{
- parallelize: parallelize,
- }
+ ewg := NewErrorWaitGroup(maxParallelization)
for _, location := range locations {
ewg.Add(func() error {
if err := markVolumeReplicaWritable(commandEnv.option.GrpcDialOption, vid, location, false, false); err != nil {