mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -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()
|
localPaths := globalEndpoints.LocalDisksPaths()
|
||||||
|
var ignoredPaths []string
|
||||||
paths := func() (tmpPaths []string) {
|
paths := func() (tmpPaths []string) {
|
||||||
for _, lp := range localPaths {
|
for _, lp := range localPaths {
|
||||||
|
if _, err := Lstat(pathJoin(lp, minioMetaBucket, formatConfigFile)); err == nil {
|
||||||
tmpPaths = append(tmpPaths, pathJoin(lp, minioMetaTmpBucket))
|
tmpPaths = append(tmpPaths, pathJoin(lp, minioMetaTmpBucket))
|
||||||
|
} else {
|
||||||
|
// Use dperf on only formatted drives.
|
||||||
|
ignoredPaths = append(ignoredPaths, lp)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return tmpPaths
|
return tmpPaths
|
||||||
}()
|
}()
|
||||||
@ -274,6 +280,12 @@ func driveSpeedTest(ctx context.Context, opts madmin.DriveSpeedTestOpts) madmin.
|
|||||||
}
|
}
|
||||||
results = append(results, result)
|
results = append(results, result)
|
||||||
}
|
}
|
||||||
|
for _, inp := range ignoredPaths {
|
||||||
|
results = append(results, madmin.DrivePerf{
|
||||||
|
Path: inp,
|
||||||
|
Error: errFaultyDisk.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
return results
|
return results
|
||||||
}(),
|
}(),
|
||||||
Error: func() string {
|
Error: func() string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user