mirror of
https://github.com/minio/minio.git
synced 2025-04-01 10:13:42 -04:00
Check for progress before we reach the limit (#17552)
This commit is contained in:
parent
66bea3942a
commit
e20aab25ec
@ -629,6 +629,10 @@ const (
|
|||||||
// for local and (incoming) remote disk ops respectively.
|
// for local and (incoming) remote disk ops respectively.
|
||||||
var diskMaxConcurrent = 512
|
var diskMaxConcurrent = 512
|
||||||
|
|
||||||
|
// diskStartChecking is a threshold above which we will start to check
|
||||||
|
// the state of disks.
|
||||||
|
var diskStartChecking = 32
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
s := env.Get("_MINIO_DISK_MAX_CONCURRENT", "512")
|
s := env.Get("_MINIO_DISK_MAX_CONCURRENT", "512")
|
||||||
diskMaxConcurrent, _ = strconv.Atoi(s)
|
diskMaxConcurrent, _ = strconv.Atoi(s)
|
||||||
@ -636,6 +640,10 @@ func init() {
|
|||||||
logger.Info("invalid _MINIO_DISK_MAX_CONCURRENT value: %s, defaulting to '512'", s)
|
logger.Info("invalid _MINIO_DISK_MAX_CONCURRENT value: %s, defaulting to '512'", s)
|
||||||
diskMaxConcurrent = 512
|
diskMaxConcurrent = 512
|
||||||
}
|
}
|
||||||
|
diskStartChecking = 16 + diskMaxConcurrent/8
|
||||||
|
if diskStartChecking > diskMaxConcurrent {
|
||||||
|
diskStartChecking = diskMaxConcurrent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type diskHealthTracker struct {
|
type diskHealthTracker struct {
|
||||||
@ -708,8 +716,8 @@ func (p *xlStorageDiskIDCheck) TrackDiskHealth(ctx context.Context, s storageMet
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return early if disk is faulty already.
|
// Return early if disk is faulty already.
|
||||||
if atomic.LoadInt32(&p.health.status) == diskHealthFaulty {
|
if err := p.checkHealth(ctx); err != nil {
|
||||||
return ctx, done, errFaultyDisk
|
return ctx, done, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify if the disk is not stale
|
// Verify if the disk is not stale
|
||||||
@ -792,7 +800,7 @@ func (p *xlStorageDiskIDCheck) checkHealth(ctx context.Context) (err error) {
|
|||||||
return errFaultyDisk
|
return errFaultyDisk
|
||||||
}
|
}
|
||||||
// Check if there are tokens.
|
// Check if there are tokens.
|
||||||
if len(p.health.tokens) > 0 {
|
if diskMaxConcurrent-len(p.health.tokens) < diskStartChecking {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user