mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: make sure to convert the error properly in HealBucket() (#11610)
server startup code expects the object layer to properly convert error into a proper type, so that in situations when servers are coming up and quorum is not available servers wait on each other.
This commit is contained in:
parent
2a79ea0332
commit
aa7244a9a4
@ -1367,11 +1367,11 @@ func (s *erasureSets) HealBucket(ctx context.Context, bucket string, opts madmin
|
|||||||
SetCount: s.setCount,
|
SetCount: s.setCount,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, s := range s.sets {
|
for _, set := range s.sets {
|
||||||
var healResult madmin.HealResultItem
|
var healResult madmin.HealResultItem
|
||||||
healResult, err = s.HealBucket(ctx, bucket, opts)
|
healResult, err = set.HealBucket(ctx, bucket, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, toObjectErr(err, bucket)
|
||||||
}
|
}
|
||||||
result.Before.Drives = append(result.Before.Drives, healResult.Before.Drives...)
|
result.Before.Drives = append(result.Before.Drives, healResult.Before.Drives...)
|
||||||
result.After.Drives = append(result.After.Drives, healResult.After.Drives...)
|
result.After.Drives = append(result.After.Drives, healResult.After.Drives...)
|
||||||
|
@ -311,6 +311,8 @@ func initServer(ctx context.Context, newObject ObjectLayer) error {
|
|||||||
if errors.Is(err, errDiskNotFound) ||
|
if errors.Is(err, errDiskNotFound) ||
|
||||||
errors.Is(err, errConfigNotFound) ||
|
errors.Is(err, errConfigNotFound) ||
|
||||||
errors.Is(err, context.DeadlineExceeded) ||
|
errors.Is(err, context.DeadlineExceeded) ||
|
||||||
|
errors.Is(err, errErasureWriteQuorum) ||
|
||||||
|
errors.Is(err, errErasureReadQuorum) ||
|
||||||
errors.As(err, &rquorum) ||
|
errors.As(err, &rquorum) ||
|
||||||
errors.As(err, &wquorum) ||
|
errors.As(err, &wquorum) ||
|
||||||
isErrBucketNotFound(err) {
|
isErrBucketNotFound(err) {
|
||||||
@ -355,14 +357,12 @@ func initAllSubsystems(ctx context.Context, newObject ObjectLayer) (err error) {
|
|||||||
for index := range buckets {
|
for index := range buckets {
|
||||||
index := index
|
index := index
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
if _, berr := newObject.HealBucket(ctx, buckets[index].Name, madmin.HealOpts{Recreate: true}); berr != nil {
|
_, berr := newObject.HealBucket(ctx, buckets[index].Name, madmin.HealOpts{Recreate: true})
|
||||||
return fmt.Errorf("Unable to list buckets to heal: %w", berr)
|
return berr
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}, index)
|
}, index)
|
||||||
}
|
}
|
||||||
if err := g.WaitErr(); err != nil {
|
if err := g.WaitErr(); err != nil {
|
||||||
return err
|
return fmt.Errorf("Unable to list buckets to heal: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,6 +371,8 @@ func initAllSubsystems(ctx context.Context, newObject ObjectLayer) (err error) {
|
|||||||
if errors.Is(err, errDiskNotFound) ||
|
if errors.Is(err, errDiskNotFound) ||
|
||||||
errors.Is(err, errConfigNotFound) ||
|
errors.Is(err, errConfigNotFound) ||
|
||||||
errors.Is(err, context.DeadlineExceeded) ||
|
errors.Is(err, context.DeadlineExceeded) ||
|
||||||
|
errors.Is(err, errErasureWriteQuorum) ||
|
||||||
|
errors.Is(err, errErasureReadQuorum) ||
|
||||||
errors.As(err, &rquorum) ||
|
errors.As(err, &rquorum) ||
|
||||||
errors.As(err, &wquorum) ||
|
errors.As(err, &wquorum) ||
|
||||||
isErrBucketNotFound(err) {
|
isErrBucketNotFound(err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user