mon: fix host ID collision with downed OSDs in fold_prev_pgs #221

Open
pan.guihua wants to merge 1 commits from pan.guihua/vitastor:master into master
First-time contributor

Description

In fold_prev_pgs, when trailing OSDs go down, newly assigned folded node IDs (max online OSD + 1) can collide with the downed OSD IDs. Map unmapped OSDs to 0 only when their ID collides with a folded node ID (extracted_nodes[osd]), preserving unfolded online OSDs (e.g. failure_domain: 'osd' or partial folding). Add unit tests covering full folding, no folding, and partial folding in test-optimize-fold.js.

Contributor Name

Guihua Pan

CLA

### Description In `fold_prev_pgs`, when trailing OSDs go down, newly assigned folded node IDs (max online OSD + 1) can collide with the downed OSD IDs. Map unmapped OSDs to `0` only when their ID collides with a folded node ID (`extracted_nodes[osd]`), preserving unfolded online OSDs (e.g. `failure_domain: 'osd'` or partial folding). Add unit tests covering full folding, no folding, and partial folding in `test-optimize-fold.js`. ### Contributor Name Guihua Pan ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
pan.guihua added 1 commit 2026-12-02 12:46:48 +03:00
In `fold_prev_pgs`, when trailing OSDs go down, newly assigned folded host IDs (max online OSD + 1) can collide with the downed OSD IDs. Fallback unmapped OSDs to `0` instead of keeping `osd` so they are not mistaken for folded host IDs, and add a unit test in `test-optimize-fold.js`.
pan.guihua force-pushed master from e48c28014c to 7381fd11fb 2026-12-03 09:29:07 +03:00 Compare
pan.guihua added 1 commit 2026-12-04 03:48:52 +03:00
pan.guihua force-pushed master from 6387c31bec to 8f61755389 2026-12-04 10:57:11 +03:00 Compare
pan.guihua force-pushed master from 8f61755389 to 1ba16d2e13 2026-12-04 11:08:47 +03:00 Compare
pan.guihua requested review from vitalif 2026-12-04 11:25:18 +03:00
pan.guihua force-pushed master from 1ba16d2e13 to ad4b2fba51 2026-12-04 11:26:02 +03:00 Compare
pan.guihua force-pushed master from ad4b2fba51 to 1ba16d2e13 2026-12-04 11:33:43 +03:00 Compare
pan.guihua force-pushed master from 1ba16d2e13 to d3a44d5b05 2026-12-04 12:06:26 +03:00 Compare
This pull request can be merged automatically.
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 master:pan.guihua-master
git checkout pan.guihua-master
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#221
No description provided.