add new errors for Disks with timeouts (#17770)

This commit is contained in:
Harshavardhana
2023-08-01 12:47:50 -07:00
committed by GitHub
parent 311380f8cb
commit a7a7533190
5 changed files with 13 additions and 19 deletions

View File

@@ -275,6 +275,10 @@ func (p *xlStorageDiskIDCheck) DiskInfo(ctx context.Context, metrics bool) (info
si := p.updateStorageMetrics(storageMetricDiskInfo)
defer si(&err)
if metrics {
info.Metrics = p.getMetrics()
}
if p.health.isFaulty() {
// if disk is already faulty return faulty for 'mc admin info' output and prometheus alerts.
return info, errFaultyDisk
@@ -285,10 +289,6 @@ func (p *xlStorageDiskIDCheck) DiskInfo(ctx context.Context, metrics bool) (info
return info, err
}
if metrics {
info.Metrics = p.getMetrics()
}
// check cached diskID against backend
// only if its non-empty.
if p.diskID != "" && p.diskID != info.ID {
@@ -860,10 +860,9 @@ func (p *xlStorageDiskIDCheck) TrackDiskHealth(ctx context.Context, s storageMet
p.health.tokens <- struct{}{}
if errp != nil {
err := *errp
if err != nil && !errors.Is(err, io.EOF) {
return
if err == nil || errors.Is(err, io.EOF) {
p.health.logSuccess()
}
p.health.logSuccess()
}
si(errp)
})