add nodeName to the log while taking drive offline (#17124)

This commit is contained in:
Harshavardhana 2023-05-03 15:05:45 -07:00 committed by GitHub
parent 9571b0825e
commit e372e4e592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -781,7 +781,7 @@ func (p *xlStorageDiskIDCheck) checkHealth(ctx context.Context) (err error) {
t = time.Since(time.Unix(0, atomic.LoadInt64(&p.health.lastSuccess)))
if t > maxTimeSinceLastSuccess {
if atomic.CompareAndSwapInt32(&p.health.status, diskHealthOK, diskHealthFaulty) {
logger.LogAlwaysIf(ctx, fmt.Errorf("taking drive %s offline, time since last response %v", p.storage.String(), t.Round(time.Millisecond)))
logger.LogAlwaysIf(ctx, fmt.Errorf("node(%s): taking drive %s offline, time since last response %v", globalLocalNodeName, p.storage.String(), t.Round(time.Millisecond)))
go p.monitorDiskStatus()
}
return errFaultyDisk
@ -813,7 +813,7 @@ func (p *xlStorageDiskIDCheck) monitorDiskStatus() {
Force: false,
})
if err == nil {
logger.Info("Able to read+write+delete, bringing drive %s online. Drive was offline for %s.", p.storage.String(),
logger.Info("node(%s): Read/Write/Delete successful, bringing drive %s online. Drive was offline for %s.", globalLocalNodeName, p.storage.String(),
time.Since(time.Unix(0, atomic.LoadInt64(&p.health.lastSuccess))))
atomic.StoreInt32(&p.health.status, diskHealthOK)
return