mirror of
https://github.com/minio/minio.git
synced 2025-02-23 03:22:30 -05:00
fix: add fallbackDisks for disk healing (#19425)
This commit is contained in:
parent
51fc145161
commit
04101d472f
@ -53,6 +53,10 @@ func (er erasureObjects) listAndHeal(bucket, prefix string, scanMode madmin.Heal
|
|||||||
return errors.New("listAndHeal: No non-healing drives found")
|
return errors.New("listAndHeal: No non-healing drives found")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expectedDisks := len(disks)/2 + 1
|
||||||
|
fallbackDisks := disks[expectedDisks:]
|
||||||
|
disks = disks[:expectedDisks]
|
||||||
|
|
||||||
// How to resolve partial results.
|
// How to resolve partial results.
|
||||||
resolver := metadataResolutionParams{
|
resolver := metadataResolutionParams{
|
||||||
dirQuorum: 1,
|
dirQuorum: 1,
|
||||||
@ -69,6 +73,7 @@ func (er erasureObjects) listAndHeal(bucket, prefix string, scanMode madmin.Heal
|
|||||||
|
|
||||||
lopts := listPathRawOptions{
|
lopts := listPathRawOptions{
|
||||||
disks: disks,
|
disks: disks,
|
||||||
|
fallbackDisks: fallbackDisks,
|
||||||
bucket: bucket,
|
bucket: bucket,
|
||||||
path: path,
|
path: path,
|
||||||
filterPrefix: filterPrefix,
|
filterPrefix: filterPrefix,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2015-2022 MinIO, Inc.
|
// Copyright (c) 2015-2024 MinIO, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of MinIO Object Storage stack
|
// This file is part of MinIO Object Storage stack
|
||||||
//
|
//
|
||||||
@ -20,6 +20,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
@ -204,6 +205,10 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
|
|||||||
if _, err := objAPI.HealBucket(ctx, bucket, madmin.HealOpts{
|
if _, err := objAPI.HealBucket(ctx, bucket, madmin.HealOpts{
|
||||||
ScanMode: scanMode,
|
ScanMode: scanMode,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
// Set this such that when we return this function
|
||||||
|
// we let the caller retry this disk again for the
|
||||||
|
// buckets that failed healing.
|
||||||
|
retErr = err
|
||||||
healingLogIf(ctx, err)
|
healingLogIf(ctx, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -230,10 +235,13 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit listing to 3 drives.
|
rand.Shuffle(len(disks), func(i, j int) {
|
||||||
if len(disks) > 3 {
|
disks[i], disks[j] = disks[j], disks[i]
|
||||||
disks = disks[:3]
|
})
|
||||||
}
|
|
||||||
|
expectedDisks := len(disks)/2 + 1
|
||||||
|
fallbackDisks := disks[expectedDisks:]
|
||||||
|
disks = disks[:expectedDisks]
|
||||||
|
|
||||||
type healEntryResult struct {
|
type healEntryResult struct {
|
||||||
bytes uint64
|
bytes uint64
|
||||||
@ -436,6 +444,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
|
|||||||
|
|
||||||
err := listPathRaw(ctx, listPathRawOptions{
|
err := listPathRaw(ctx, listPathRawOptions{
|
||||||
disks: disks,
|
disks: disks,
|
||||||
|
fallbackDisks: fallbackDisks,
|
||||||
bucket: actualBucket,
|
bucket: actualBucket,
|
||||||
path: prefix,
|
path: prefix,
|
||||||
recursive: true,
|
recursive: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user