mirror of
https://github.com/minio/minio.git
synced 2026-11-25 07:21:49 +00:00
fix: heal multiple buckets in bulk (#11029)
makes server startup, orders of magnitude faster with large number of buckets
This commit is contained in:
1 parent
3514e89eb3
commit
9c53cc1b83
11 files changed
+159
-126
No files matched your search
@@ -424,6 +424,28 @@ func (z *erasureServerPools) CrawlAndGetDataUsage(ctx context.Context, bf *bloom
|
||||
return firstErr
|
||||
}
|
||||
|
||||
func (z *erasureServerPools) MakeMultipleBuckets(ctx context.Context, buckets ...string) error {
|
||||
g := errgroup.WithNErrs(len(z.serverPools))
|
||||
|
||||
// Create buckets in parallel across all sets.
|
||||
for index := range z.serverPools {
|
||||
index := index
|
||||
g.Go(func() error {
|
||||
return z.serverPools[index].MakeMultipleBuckets(ctx, buckets...)
|
||||
}, index)
|
||||
}
|
||||
|
||||
errs := g.Wait()
|
||||
// Return the first encountered error
|
||||
for _, err := range errs {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MakeBucketWithLocation - creates a new bucket across all serverPools simultaneously
|
||||
// even if one of the sets fail to create buckets, we proceed all the successful
|
||||
// operations.
|
||||
|
||||
Reference in new issue
Block a user