← Back to Pull requests

doc/dev: ec_stretch_cluster: refactor global stretch mode #54

Closed
unknown closed this pull request without merging on Oct 13, 2026 14:08 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 10:52 UTC
Author

<!--
- Please give your pull request a title like

[component]: [short description]

- Please use this format for each git commit message:

[component]: [short description]

[A longer multiline description]

Fixes: [ticket URL on tracker.ceph.com, create one if necessary]
Signed-off-by: [Your Name] <[your email]>

For examples, use "git log".
-->

Refactors global stretch mode, as agreed: whether a pool is stretched depends only on its own num_zones, every ceph osd pool create parameter takes its default from an osd_pool_default_ option, and ceph mon enable_stretch_mode / disable_stretch_mode become commands that set those defaults and change every pool.

The first commit is the design (doc/dev/osd_internals/erasure_coding/ec_stretch_cluster.rst, Sections 2.3, 11.3, 13.2 and 15). Commits 2–12 implement it. The commits after them answer reviews; each says which commit it will be squashed into before merge, or that it stays on its own.

Commits

1. doc/dev: ec_stretch_cluster: refactor global stretch mode: the design.
2. osd: pg_pool_t num_zones and replica in v34, total min_size before.
3. mon: pool create takes its defaults from osd_pool_default_
options: new osd_pool_default_replica, _num_zones, _zone_failure_domain, _osd_failure_domain, _root, _class.
4. mon: build and check pool create parameters in four steps: load the defaults, use the erasure code profile, apply the command line, check the result (src/mon/PoolCreateParams.{h,cc}), shared by pool create (command and librados), ceph osd pool default set and the stretch mode commands.
5. mon: add ceph osd pool default set and get: plus the POOL_DEFAULT_OVERRIDDEN health warning.
6. mon: replace global stretch mode with per-pool num_zones commands.
7. mon: wait for the upgrade commit before num_zones can change.
8. mon,mgr: size new pools as num_zones times the replicas per zone.
9. doc: stretch mode commands and pool creation defaults.
10. mon: recompute nonprimary_shards when a pool's num_zones changes.
11. qa/standalone: test pool creation defaults and stretch mode commands.
12. mon: use osd_pool_default_crush_rule for every pool it suits.

Review responses (owner review, and an independent review of the PR):

  • Not to be squashed, as they fix stretchy-C behaviour: mon/OSDMonitor: refuse osd pool stretch set for EC pools again (#41's refusal, undone by #35's merge) and mon/OSDMonitor: keep stretch set's min_size as a total over all zones.

  • Not to be squashed, as it fixes a main defect and will be proposed for main too: mon/ConfigMap: report the section that gives an entity's value (ceph config get <who> named the least specific section that sets an option, not the one whose value is used; POOL_DEFAULT_OVERRIDDEN asks the same question).

  • To be squashed: #57 folded into the design; num_zones 2 checked against stretch mode; duplicate helpers removed or shared; at most two zones and 128 OSDs per pool, and LRC profiles left to their plugin; crimson config getters; default set checks a min_size default only against the replicas per zone, not as an EC pool; disable_stretch_mode resets defaults left without stretch mode; the teuthology task's pool; per-monitor mask checks in POOL_DEFAULT_OVERRIDDEN; design text fixes; standalone test expectations for the four-step order of checks.
  • Points for reviewers

    1. Release. No Vampire release or feature bit exists yet, so struct version 34 and the upgrade gate (OSDMonitor::NUM_ZONES_RELEASE) use Umbrella. Both move to Vampire together once it is defined.
    2. Open design questions for the design call: min_size across the upgrade; librados (RGW) pool creation in a stretched cluster; EC profiles versus the default CRUSH rule; a repeated enable_stretch_mode; what default set promises; named profiles and the zone type; deleting the user's stretch rule; legacy EC pools blocking enable_stretch_mode.
    3. Known defects still open in this PR, fixes to follow: enable_stretch_mode/disable_stretch_mode do not plug Paxos, so the MonMap can commit before the pools and defaults; default set --rule <EC rule> breaks replicated pool creation; default_rule_suits_pool ignores how many OSDs a rule puts in each zone (to use #60's check); the commit-time conversion misses a legacy enable or disable in the same epoch.
    4. More than two zones are refused by pool create, default set and num_zones; only main's individual stretch pools (ceph osd pool stretch set) span more sites.
    5. osd_pool_default_replica defaults to 0, meaning "use osd_pool_default_size", because Ceph config has no option aliases.
    6. ceph osd pool default is served by ConfigMonitor (config caps, plus a routing exception in Monitor) and refuses values that a mon section or a monitor's local configuration overrides.

    Testing

  • Full build and ninja tests (WITH_CRIMSON=OFF; the crimson getters are not compiled locally).

  • Unit tests: unittest_pool_create_params, unittest_pool_defaults, unittest_osd_monitor, unittest_osd_types, unittest_ecutil, unittest_ecfailover_with_peering, unittest_ecbackend, unittest_osdmap and the stretch EC unit tests.

  • qa/standalone, 19 suites: all of mon-stretch/, crush/crush-stretch.sh, mon/osd-pool-create.sh, mon/misc.sh, mon/osd-erasure-code-profile.sh and erasure-code/test-erasure-code.sh. 16 passed on dccad0b08ed. The other 3 (mon-stretch-pool-defaults.sh, crush-stretch.sh, mon-stretch-replicated-placement-options.sh) failed there and pass with the last three commits. The other 16 have not been rerun since those commits.

  • On a cluster, with the binary from before refuse osd pool stretch set for EC pools again: mon-stretch-commands.sh TEST_stretch_set_ec_pool fails, and it passes with the fix.

  • Not run: teuthology (qa/tasks/stretch_mode_disable_enable.py was updated).
  • 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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.
  • Checklist


  • Tracker (select at least one)

  • - [ ] References tracker ticket
    - [ ] Very recent bug; references commit where it was introduced
    - [x] New feature (ticket optional)
    - [ ] Doc update (no ticket needed)
    - [ ] Code cleanup (no ticket needed)
  • Component impact

  • - [ ] Affects Dashboard, opened tracker ticket
    - [ ] Affects Orchestrator, opened tracker ticket
    - [x] No impact that needs to be tracked
  • Documentation (select at least one)

  • - [x] Updates relevant documentation
    - [ ] No doc update is appropriate
  • Tests (select at least one)

  • - [x] Includes unit test(s)
    - [x] Includes integration test(s)
    - [ ] Includes bug reproducer
    - [ ] No tests

    <details>
    <summary>Show available Jenkins commands</summary>

  • jenkins test classic perf Jenkins Job | Jenkins Job Definition

  • jenkins test crimson perf Jenkins Job | Jenkins Job Definition

  • jenkins test signed Jenkins Job | Jenkins Job Definition

  • jenkins test make check Jenkins Job | Jenkins Job Definition

  • jenkins test make check arm64 Jenkins Job | Jenkins Job Definition

  • jenkins test submodules Jenkins Job | Jenkins Job Definition

  • jenkins test dashboard Jenkins Job | Jenkins Job Definition

  • jenkins test dashboard cephadm Jenkins Job | Jenkins Job Definition

  • jenkins test api Jenkins Job | Jenkins Job Definition

  • jenkins test docs ReadTheDocs | Github Workflow Definition

  • jenkins test ceph-volume all Jenkins Jobs | Jenkins Jobs Definition

  • jenkins test windows Jenkins Job | Jenkins Job Definition

  • jenkins test rook e2e Jenkins Job | Jenkins Job Definition
  • You must only issue one Jenkins command per-comment. Jenkins does not understand
    comments with more than one command.
    </details>

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: kamoltat Review duration: 7395m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #54"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository