osd: Make recovery_pg_switch switch to the next PG #195

Open
koolkhel wants to merge 1 commits from koolkhel/vitastor:osd-recovery-pg-switch into master

1 Commits

Author SHA1 Message Date
9b3b09ce12 osd: Make recovery_pg_switch switch to the next PG
pick_next_recovery never remembered which PG it took an object from, so
recovery_last_pg.pg_num++ only advanced {0, N} and lower_bound() found the
first PG again: PGs were recovered one by one. Since the tombstone cleanup
the kind also rotates after every pick, and every kind without work reset
the shared position.

Keep a separate position for each recovery kind, remember the PG on every
pick, scan the next PG from its first object, skip a backfillfull pool
from its first PG, and rescan the kind from the beginning when nothing is
found after the position.

Based on a fix by Vitaliy Idelson.
2026-11-26 11:40:11 +03:00