aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_encode.go
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2024-12-12 18:14:44 +0100
committerGitHub <noreply@github.com>2024-12-12 09:14:44 -0800
commitb0210df08151e32cb67d5199008870f5fc25827a (patch)
tree28cbfebbe2289ee4059fde4eed16a741c820110c /weed/shell/command_ec_encode.go
parent23ffbb083c4bcc9d723ce5857e08f85e7205140a (diff)
downloadseaweedfs-b0210df08151e32cb67d5199008870f5fc25827a.tar.xz
seaweedfs-b0210df08151e32cb67d5199008870f5fc25827a.zip
Begin implementing EC balancing parallelization support. (#6342)
* Begin implementing EC balancing parallelization support. Impacts both `ec.encode` and `ec.balance`, * Nit: improve type naming. * Make the goroutine workgroup handler for `EcBalance()` a bit smarter/error-proof. * Nit: unify naming for `ecBalancer` wait group methods with the rest of the module. * Fix concurrency bug. * Fix whitespace after Gitlab automerge. * Delete stray TODO.
Diffstat (limited to 'weed/shell/command_ec_encode.go')
-rw-r--r--weed/shell/command_ec_encode.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go
index f8b881d7c..62bf7fbbf 100644
--- a/weed/shell/command_ec_encode.go
+++ b/weed/shell/command_ec_encode.go
@@ -65,8 +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")
- // TODO: Add concurrency support to EcBalance and reenable this switch?
- //parallelCopy := encodeCommand.Bool("parallelCopy", true, "copy shards in parallel")
+ parallelize := encodeCommand.Bool("parallelize", true, "parallelize operations 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")
@@ -125,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, *applyBalancing); err != nil {
+ if err := EcBalance(commandEnv, collections, "", rp, *parallelize, *applyBalancing); err != nil {
return fmt.Errorf("re-balance ec shards for collection(s) %v: %v", collections, err)
}