Allow configuring the maximum number of concurrent tasks for EC parallelization. (#6376)

Follow-up to b0210df0.
This commit is contained in:
Lisandro Pin
2024-12-18 22:26:26 +01:00
committed by GitHub
parent 44c48c929a
commit ba0707af64
3 changed files with 52 additions and 49 deletions

View File

@@ -65,7 +65,7 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
collection := encodeCommand.String("collection", "", "the collection name")
fullPercentage := encodeCommand.Float64("fullPercent", 95, "the volume reaches the percentage of max volume size")
quietPeriod := encodeCommand.Duration("quietFor", time.Hour, "select volumes without no writes for this period")
parallelize := encodeCommand.Bool("parallelize", true, "parallelize operations whenever possible")
maxParallelization := encodeCommand.Int("maxParallelization", 10, "run up to X tasks in parallel, whenever possible")
forceChanges := encodeCommand.Bool("force", false, "force the encoding even if the cluster has less than recommended 4 nodes")
shardReplicaPlacement := encodeCommand.String("shardReplicaPlacement", "", "replica placement for EC shards, or master default if empty")
applyBalancing := encodeCommand.Bool("rebalance", false, "re-balance EC shards after creation")
@@ -124,7 +124,7 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
}
}
// ...then re-balance ec shards.
if err := EcBalance(commandEnv, collections, "", rp, *parallelize, *applyBalancing); err != nil {
if err := EcBalance(commandEnv, collections, "", rp, *maxParallelization, *applyBalancing); err != nil {
return fmt.Errorf("re-balance ec shards for collection(s) %v: %v", collections, err)
}