Repository navigation
Conversation
|
Sorry for the direct ping — @rzarzynski @ljflores, this touches I tried to answer the upgrade question from #47189 up front in the description, since I imagine it comes up here too: the new code rejects a strict subset of what the old one did, and I checked that by running every ordered mapping of three rule shapes through both versions (none of the 1722 flips from accepted to rejected). There is also an osdmaptool-only reproducer in there if that is an easier place to start than the patch. Happy to make any changes you suggest — I will turn them around quickly. |
|
ok to test |
|
Thank you @phlogistonjohn, much appreciated — CI is running now. |
|
All checks are green now (make check, arm64, API and windows tests). Happy to answer any questions or make changes. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
70b95ec to
df0e494
Compare
c5d6991 to
e62f9b4
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
e62f9b4 to
718b0d3
Compare
|
Noted that I need to review this. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
718b0d3 to
66b31e2
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
… classes
verify_upmap checks each choose/chooseleaf step of a rule against the
whole `up` vector. For rules with multiple take steps (e.g. hybrid
rules placing some replicas on one device class and the rest on
another), this counts OSDs of other take scopes against the current
step's constraint. Worse, with device classes the same physical
failure domain is counted once per class shadow bucket, so a rule like
take default~ssd
choose firstn 2 type zone
chooseleaf firstn 1 type host
emit
take default~hdd
choose firstn 2 type zone
chooseleaf firstn 1 type host
emit
always fails validation ("number of buckets 4 exceeds desired 2"): the
two physical zones are seen as four distinct buckets (dc1~ssd, dc2~ssd,
dc1~hdd, dc2~hdd). As a result every pg-upmap-items entry on pools
using such rules is cancelled by the mon right after being set, and
the upmap balancer can never optimize those pools.
Fix this by deferring the choose/chooseleaf checks to EMIT, where the
take scope's segment of `up` is known: check only the OSDs of that
segment, and resolve their parents within the current take subtree
only. Single-take rules see no behavior change.
Fixes: https://tracker.ceph.com/issues/79493
Signed-off-by: Woojoong Kim <[email protected]>
Signed-off-by: Woojoong Kim <[email protected]>
66b31e2 to
d5c3a45
Compare
|
@ljflores rebased onto main and resolved the release notes conflict. The code and tests are unchanged. Could you reapprove CI for the updated commits? Thanks! |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
verify_upmap()checks each choose/chooseleaf step against the entireupvector.For a rule with more than one take step - hybrid device-class rules, mainly - that
counts OSDs belonging to other take scopes against the current step's constraint. On
top of that, parents are resolved through the per-class shadow trees of all of the
rule's takes, so the same physical failure domain gets counted once per device class.
The result is that for the documented hybrid layout (one ssd and one hdd per zone,
ssd take first so the primary lands there) every upmap is rejected, including the
ones that match the rule exactly:
Two physical zones, seen as four buckets: dc1
ssd, dc2ssd, dc1hdd, dc2hdd. The moncancels each pg-upmap-items entry right after it is set (check_pg_upmaps), and the
upmap balancer can never touch those pools either, since calc_pg_upmaps -> legal_swap
fails the same way. That leaves
osd reweightas the only balancing tool. We hit thisin production when a node failure pushed one OSD to 90% (backfillfull) while its
same-zone peers sat at 25%, and there was no upmap we could apply to relieve it.
Fix
Defer the choose/chooseleaf checks to EMIT, where the take scope's segment of
upisknown - the EMIT handler already computes that segment length for its subtree
containment check. Check only the OSDs in the current segment, and resolve their
parents within the current take subtree, which also gets rid of the cross-take
shadow-bucket double count. Nothing changes for single-take rules: there the segment
is the whole
upvector and the parent search space is the same single take root asbefore.
This is orthogonal to #69151, which fixes a different false rejection in the same
function (nested choose steps within one take). I checked both directions: with
#69151 applied the hybrid reproducer above still fails, and with this patch applied
the rule shape from #51729 is still rejected exactly as before (same verdicts for the
exact shape and a set of permutations). So neither patch subsumes the other. Happy to
rebase on top of it either way.
Offline reproducer
No cluster needed. Build a small map with a hybrid rule and let the balancer fill in
some upmaps, then ask osdmaptool to revalidate them:
Before the patch the last command rejects all 20 entries:
After the patch it rejects none, and cleanup.txt is empty. The crush map used above
is the rule from the tracker ticket over two zones of three hosts, one ssd and one
hdd per host.
Behavior change surface
The set of rejected mappings is a strict subset of what it was. The old code checked
every step against a superset of the OSDs (whole
upinstead of the scope's segment)and resolved parents in a superset of the search space (all take roots via
find_takes_by_rule instead of the current root), and both comparisons are monotonic in
those inputs. Nothing that was accepted before can be rejected now, so stored upmaps
keep validating and no mass cancellation can happen on upgrade.
I checked that by brute force rather than by argument. Over the topology of the unit
test, every ordered mapping was fed to verify_upmap on both versions:
Note the first row: the old code rejects all 840 mappings for a hybrid rule, so no
cluster can have a stored upmap on such a pool to begin with - there is no state to
regress. The same-root row is the intended semantic change: the newly accepted
mappings are the ones placing replicas of different take scopes on one host, which
CRUSH itself produces for those rules since the scopes are drawn independently.
Single-take rules are bit for bit unchanged.
Running osdmaptool --upmap-cleanup with both versions over a single-take pool with 30
stored upmap entries also gives identical output (nothing cancelled either way).
Tests
unittest_crush_wrapper --gtest_filter='*verify_upmap*':I have a standalone test for this as well (build a hybrid rule on a live cluster, set a
rule-compliant pg-upmap-items entry, check the mon still has it a few osdmap epochs
later) but I could not run it on my machine, so I left it out rather than send
something I have not exercised. Say the word and I will get it verified and add it.
Local validation: CrushWrapper suite 26/26 on the rebased sources, and the existing
OSDMap regression suite 41/41 (including BUG_40104 / BUG_42485 / BUG_51842) relinked
with the rebased CrushWrapper. Existing build dependencies were reused; a full
project rebuild has not been run.
Fixes: https://tracker.ceph.com/issues/79493
Related: https://tracker.ceph.com/issues/51729
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist