mon: Let any EC position lead a PG with sticky_primaries #213

Open
koolkhel wants to merge 2 commits from koolkhel/vitastor:mon-sticky-ec-parity into master
Contributor

Description

OSD sets from optimize_change() come in host order (RuleCombinator is created without ordered, only optimize_initial() rotates the sets), and EC primaries are picked from data positions only. So after a host was out and back, a host was added or a weight changed, the last parity_chunks hosts lead almost no PG: with 12 hosts and EC 8+2, hosts 11 and 12 lead none. With sticky_primaries (#198), pick the least loaded live OSD of any position. Turning the option on moves no live primary; the calm rebalance (primary_rebalance_time) then evens them out, at most one new primary per OSD per pass. Without the option nothing changes.

Cost: a parity primary has no data chunk locally, so with EC 8+2 about 2-3 % more reads go over the network. An alternative would be to pass ordered to the combinator in optimize_change(), but it does nothing for existing layouts and makes the LP several times slower.

Found: seen on a cluster (12 hosts x 48 OSDs, EC 8+2, 2048 PGs): hosts 11 and 12 led no PG. Reproduced with the monitor code on that cluster's PG map: with this change and sticky_primaries, 0 primary moves when the option is turned on, then 576 moves in 4 calm passes; hosts 11 and 12 then lead 147 and 146 PGs and every OSD leads 3-4 (before: 0-12, 99 OSDs leading nothing; #198 alone: 96 OSDs still leading nothing).

Tested: node mon/test-sticky-primaries.js, new test_host_ordered_sets (fails without the change).

Contributor Name

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

CLA

### Description OSD sets from `optimize_change()` come in host order (`RuleCombinator` is created without `ordered`, only `optimize_initial()` rotates the sets), and EC primaries are picked from data positions only. So after a host was out and back, a host was added or a weight changed, the last `parity_chunks` hosts lead almost no PG: with 12 hosts and EC 8+2, hosts 11 and 12 lead none. With `sticky_primaries` (#198), pick the least loaded live OSD of any position. Turning the option on moves no live primary; the calm rebalance (`primary_rebalance_time`) then evens them out, at most one new primary per OSD per pass. Without the option nothing changes. Cost: a parity primary has no data chunk locally, so with EC 8+2 about 2-3 % more reads go over the network. An alternative would be to pass `ordered` to the combinator in `optimize_change()`, but it does nothing for existing layouts and makes the LP several times slower. Found: seen on a cluster (12 hosts x 48 OSDs, EC 8+2, 2048 PGs): hosts 11 and 12 led no PG. Reproduced with the monitor code on that cluster's PG map: with this change and `sticky_primaries`, 0 primary moves when the option is turned on, then 576 moves in 4 calm passes; hosts 11 and 12 then lead 147 and 146 PGs and every OSD leads 3-4 (before: 0-12, 99 OSDs leading nothing; #198 alone: 96 OSDs still leading nothing). Tested: `node mon/test-sticky-primaries.js`, new `test_host_ordered_sets` (fails without the change). ### 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-01 14:57:34 +03:00
OSD sets from optimize_change() come in host order (RuleCombinator is
created without `ordered`, only optimize_initial() rotates the sets),
and EC primaries are picked from data positions only. So after a host
was out and back, a host was added or a weight changed, the last
parity_chunks hosts lead almost no PG: with 12 hosts and EC 8+2, hosts
11 and 12 lead none. With sticky_primaries, pick the least loaded live
OSD of any position. Turning the option on moves no live primary; the
calm rebalance then evens them out.
koolkhel added 1 commit 2026-12-01 15:32:46 +03:00
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-sticky-ec-parity:koolkhel-mon-sticky-ec-parity
git checkout koolkhel-mon-sticky-ec-parity
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#213
No description provided.