osd: Pause recovery of a PG after an error instead of retrying it in a loop #143

Merged
vitalif merged 2 commits from koolkhel/vitastor:osd-recovery-error-backoff into master 2026-11-21 12:53:45 +03:00

2 Commits

Author SHA1 Message Date
69756095ba osd: Keep the recovery pause on successes of operations started before it
With recovery_queue_depth > 1, an operation submitted before a failure
could succeed during the pause and reset it, so the pause never grew past
1 second. Reset it only on a success after the pause ends. Count only
ENOSPC failures in test_recovery_enospc and check that the pause grows.
2026-11-21 12:30:26 +03:00
545f4ad05d osd: Pause recovery of a PG after an error instead of retrying it in a loop
A recovery operation that fails with an error that doesn't drop the
connection (ENOSPC from a full target OSD, EIO, EDOM) was retried at once,
forever: finish_recovery_op() restarts recovery immediately and the object
stays degraded or misplaced. When the monitor doesn't mark the pool
backfillfull, for example because the OSD is filled with data it doesn't
account for, the primary spins at thousands of failures per second, each
logging two lines.

Now a failed recovery operation (except EPIPE) pauses recovery of its PG
for 1 second, doubling up to 60 seconds while it keeps failing, and a
successful one resets the pause. pick_next_recovery() skips paused PGs and
a timer resumes recovery when the nearest pause ends. Re-peering clears it.
2026-11-21 11:49:59 +03:00