mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
fix: ignore dperf on unformatted/unavailable/unmounted drives (#18435)
This commit is contained in:
parent
8b1e819bf3
commit
a7466eeb0e
@ -238,9 +238,15 @@ func driveSpeedTest(ctx context.Context, opts madmin.DriveSpeedTestOpts) madmin.
|
||||
}
|
||||
|
||||
localPaths := globalEndpoints.LocalDisksPaths()
|
||||
var ignoredPaths []string
|
||||
paths := func() (tmpPaths []string) {
|
||||
for _, lp := range localPaths {
|
||||
tmpPaths = append(tmpPaths, pathJoin(lp, minioMetaTmpBucket))
|
||||
if _, err := Lstat(pathJoin(lp, minioMetaBucket, formatConfigFile)); err == nil {
|
||||
tmpPaths = append(tmpPaths, pathJoin(lp, minioMetaTmpBucket))
|
||||
} else {
|
||||
// Use dperf on only formatted drives.
|
||||
ignoredPaths = append(ignoredPaths, lp)
|
||||
}
|
||||
}
|
||||
return tmpPaths
|
||||
}()
|
||||
@ -274,6 +280,12 @@ func driveSpeedTest(ctx context.Context, opts madmin.DriveSpeedTestOpts) madmin.
|
||||
}
|
||||
results = append(results, result)
|
||||
}
|
||||
for _, inp := range ignoredPaths {
|
||||
results = append(results, madmin.DrivePerf{
|
||||
Path: inp,
|
||||
Error: errFaultyDisk.Error(),
|
||||
})
|
||||
}
|
||||
return results
|
||||
}(),
|
||||
Error: func() string {
|
||||
|
Loading…
Reference in New Issue
Block a user