aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2025-11-02 17:54:37 +0100
committerGitHub <noreply@github.com>2025-11-02 08:54:37 -0800
commit1668c1042b5cbb7806b8f7068058f094f91ec3f3 (patch)
tree566da30e9cb5629d3b10e3a9987b2433bfc556da
parent69c49859fa2100fbec686370fb47ee90f7559685 (diff)
downloadseaweedfs-1668c1042b5cbb7806b8f7068058f094f91ec3f3.tar.xz
seaweedfs-1668c1042b5cbb7806b8f7068058f094f91ec3f3.zip
Rework collection resultion for `ec.rebuild`, in preparation for parallelization. (#7420)
* Rework collection resultion for `ec.rebuild`, in preparation for parallelization. See https://github.com/seaweedfs/seaweedfs/issues/7416 . * simplify * Update weed/shell/command_ec_rebuild.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: chrislu <chris.lu@gmail.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
-rw-r--r--weed/shell/command_ec_rebuild.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/weed/shell/command_ec_rebuild.go b/weed/shell/command_ec_rebuild.go
index cceaa1899..f0b6b5261 100644
--- a/weed/shell/command_ec_rebuild.go
+++ b/weed/shell/command_ec_rebuild.go
@@ -79,20 +79,20 @@ func (c *commandEcRebuild) Do(args []string, commandEnv *CommandEnv, writer io.W
return err
}
+ var collections []string
if *collection == "EACH_COLLECTION" {
- collections, err := ListCollectionNames(commandEnv, false, true)
+ collections, err = ListCollectionNames(commandEnv, false, true)
if err != nil {
return err
}
- fmt.Printf("rebuildEcVolumes collections %+v\n", len(collections))
- for _, c := range collections {
- fmt.Printf("rebuildEcVolumes collection %+v\n", c)
- if err = rebuildEcVolumes(commandEnv, allEcNodes, c, writer, *applyChanges); err != nil {
- return err
- }
- }
} else {
- if err = rebuildEcVolumes(commandEnv, allEcNodes, *collection, writer, *applyChanges); err != nil {
+ collections = []string{*collection}
+ }
+
+ fmt.Printf("rebuildEcVolumes for %d collection(s)\n", len(collections))
+ for _, c := range collections {
+ fmt.Printf("rebuildEcVolumes collection %s\n", c)
+ if err = rebuildEcVolumes(commandEnv, allEcNodes, c, writer, *applyChanges); err != nil {
return err
}
}