mon: Put NO_OSD last among vacated EC positions #223

Open
koolkhel wants to merge 1 commits from koolkhel/vitastor:mon-ec-hole-last into master
Contributor

Description

An undersized PG (fewer live hosts than pg_size) that loses two or more positions in one change gets NO_OSD rotated together with the new OSDs in align_positions(), so the empty slot can take a data position while a new OSD takes a parity one; reads of that data chunk then reconstruct. This keeps rotating the new OSDs and puts NO_OSD after them, in the last vacated positions, as the sorted sets did before #214. Sets without NO_OSD are not affected.

Example: 7 hosts, pg_size 6, hosts 6 and 7 out: a PG that had both gets host N and NO_OSD; with this change NO_OSD always takes the later of the two vacated positions.

Found: by reading the code after #214, then reproduced with the monitor code (the test below). Needs fewer live hosts than pg_size and two positions of one PG vacated in the same change, so it is rare; the effect is read performance of that PG until it is complete again, not data.

Tested: node mon/lp_optimizer/test-optimize-simple.js, case "7 hosts, size=6, remove hosts 6 and 7" now asserts NO_OSD in the last vacated position (fails on master: "Two new items per PG: NO_OSD in the last vacated position failed"; it replaces the assert that NO_OSD was rotated over both positions). The file's existing "Change size to 2, ordered" still fails as on master. Other mon/lp_optimizer/test-*.js pass.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description An undersized PG (fewer live hosts than pg_size) that loses two or more positions in one change gets NO_OSD rotated together with the new OSDs in `align_positions()`, so the empty slot can take a data position while a new OSD takes a parity one; reads of that data chunk then reconstruct. This keeps rotating the new OSDs and puts NO_OSD after them, in the last vacated positions, as the sorted sets did before #214. Sets without NO_OSD are not affected. Example: 7 hosts, pg_size 6, hosts 6 and 7 out: a PG that had both gets host N and NO_OSD; with this change NO_OSD always takes the later of the two vacated positions. Found: by reading the code after #214, then reproduced with the monitor code (the test below). Needs fewer live hosts than pg_size and two positions of one PG vacated in the same change, so it is rare; the effect is read performance of that PG until it is complete again, not data. Tested: `node mon/lp_optimizer/test-optimize-simple.js`, case "7 hosts, size=6, remove hosts 6 and 7" now asserts NO_OSD in the last vacated position (fails on master: "Two new items per PG: NO_OSD in the last vacated position failed"; it replaces the assert that NO_OSD was rotated over both positions). The file's existing "Change size to 2, ordered" still fails as on master. Other `mon/lp_optimizer/test-*.js` pass. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-12-02 19:58:41 +03:00
An undersized PG that loses two or more positions in one change got
NO_OSD rotated together with the new OSDs, so the empty slot could take
a data position (reads of that chunk then reconstruct) while a new OSD
took a parity one. Keep rotating the new OSDs and put NO_OSD after
them, as the sorted sets did before.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u mon-ec-hole-last:koolkhel-mon-ec-hole-last
git checkout koolkhel-mon-ec-hole-last
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#223
No description provided.