Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Rework collection resultion for `ec.rebuild`, in preparation for parallelization. (#7420)

Lisandro Pin1668c1042b5c
diff --git a/weed/shell/command_ec_rebuild.go b/weed/shell/command_ec_rebuild.go
index cceaa1899f..f0b6b5261c 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
}
}