mon: Optimise from current PGs if last_clean_pgs would move more data #179

Open
koolkhel wants to merge 2 commits from koolkhel/vitastor:mon-pg-base-fewer-moves into master

2 Commits

Author SHA1 Message Date
70614e534d mon: Also run test-pg-base.js on a replicated pool 2026-11-25 02:43:39 +03:00
4f4291342f mon: Optimise from current PGs if last_clean_pgs would move more data
last_clean_pgs is only updated when the whole pool is clean, and every
re-optimisation (reweight, OSD out, pool change) starts from it. While
the pool stays unclean and the current PGs drift away from
last_clean_pgs, each round lands on a new layout and moves a large part
of the pool again.

In that case also optimise from the current PGs and take the result
which places fewer PG items on OSDs without their data, i.e. neither
the current OSD nor one from the PG history. Ties go to last_clean_pgs,
so an OSD which comes back before its PGs recover gets the same PGs.
2026-11-24 23:06:43 +03:00