pick disks which are common maximally used (#10600)

further optimization to ensure that good disks
are always used for listing, other than healing
we only use disks that are maximally used.
This commit is contained in:
Harshavardhana
2020-09-29 22:54:02 -07:00
committed by GitHub
parent 799758e54f
commit 2b4eb87d77
15 changed files with 70 additions and 16 deletions

View File

@@ -319,6 +319,22 @@ func initAllSubsystems(ctx context.Context, newObject ObjectLayer) (err error) {
if err != nil {
return fmt.Errorf("Unable to list buckets to heal: %w", err)
}
rquorum := InsufficientReadQuorum{}
wquorum := InsufficientWriteQuorum{}
for _, bucket := range buckets {
if err = newObject.MakeBucketWithLocation(ctx, bucket.Name, BucketOptions{}); err != nil {
if errors.As(err, &wquorum) || errors.As(err, &rquorum) {
// Return the error upwards for the caller to retry.
return fmt.Errorf("Unable to heal bucket: %w", err)
}
if _, ok := err.(BucketExists); !ok {
// ignore any other error and log for investigation.
logger.LogIf(ctx, err)
continue
}
// Bucket already exists, nothing that needs to be done.
}
}
} else {
buckets, err = newObject.ListBuckets(ctx)
if err != nil {