mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
mrf: Fix stale MRF data showed in heal info (#14953)
One usee reported having mc admin heal status output ETA increasing by time. It turned out it is MRF that is not clearing its data due to a bug in the code. pendingItems is increased when an object is queued to be healed but never decreasd when there is a healing error. This commit will decrease pendingItems and pendingBytes even when there is an error to give accurate reporting.
This commit is contained in:
parent
18a4276e25
commit
01e5632949
22
cmd/mrf.go
22
cmd/mrf.go
@ -218,21 +218,19 @@ func (m *mrfState) healRoutine() {
|
|||||||
|
|
||||||
// Heal objects
|
// Heal objects
|
||||||
for _, u := range mrfOperations {
|
for _, u := range mrfOperations {
|
||||||
if _, err := m.objectAPI.HealObject(m.ctx, u.bucket, u.object, u.versionID, mrfHealingOpts); err != nil {
|
_, err := m.objectAPI.HealObject(m.ctx, u.bucket, u.object, u.versionID, mrfHealingOpts)
|
||||||
// If not deleted, assume they failed.
|
|
||||||
logger.LogIf(m.ctx, err)
|
|
||||||
} else {
|
|
||||||
m.mu.Lock()
|
|
||||||
m.itemsHealed++
|
|
||||||
m.pendingItems--
|
|
||||||
m.bytesHealed += uint64(u.size)
|
|
||||||
m.pendingBytes -= uint64(u.size)
|
|
||||||
m.mu.Unlock()
|
|
||||||
}
|
|
||||||
|
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
|
if err == nil {
|
||||||
|
m.itemsHealed++
|
||||||
|
m.bytesHealed += uint64(u.size)
|
||||||
|
}
|
||||||
|
m.pendingItems--
|
||||||
|
m.pendingBytes -= uint64(u.size)
|
||||||
delete(m.pendingOps, u)
|
delete(m.pendingOps, u)
|
||||||
m.mu.Unlock()
|
m.mu.Unlock()
|
||||||
|
|
||||||
|
// Log healing error if any
|
||||||
|
logger.LogIf(m.ctx, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
waitForLowHTTPReq()
|
waitForLowHTTPReq()
|
||||||
|
Loading…
Reference in New Issue
Block a user