Skip to content

mon/OSDMonitor: size a replicated stretch pool from its zones - #49

Merged
aainscow merged 1 commit into
stretchy-Cfrom
wip-stretchy-C-pr43-05-replicated-size
Oct 7, 2026
Merged

aainscow merged 1 commit into
stretchy-Cfrom
wip-stretchy-C-pr43-05-replicated-size

Conversation

@aainscow

@aainscow aainscow commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Fifth PR split out of #43.

  • Before: osd pool create <pool> --num-zones 2 builds a stretch rule that takes num_replica_per_zone (default 2) hosts in each zone. But prepare_pool_size() ignored num_zones for a replicated pool created without a size, so the pool got osd_pool_default_size (3), and one zone held a single replica.
  • Now: such a pool gets num_zones * num_replica_per_zone (4 for the defaults). Global stretch mode keeps mon_stretch_pool_size. Section 2.1.3 of the design says so.
  • min_size is the default for the pool's size (2 for size 4), as for any other pool. The min_size design for multi-zone pools is still under discussion and will come in a separate PR, which may change this default.
  • Test: TEST_pool_create_stretch_replica in crush-stretch.sh now expects size 4 and min_size 2. Without the fix the pool gets size 3.

Testing

  • This branch is stretchy-C f2f2787 with this commit, rebased unchanged from stretchy-C 0ef148d. The build and unit tests on this branch will follow.
  • Before the rebase, this commit built with no errors or warnings, on top of the PRs before it, and unittest_mon_monmap and unittest_osd_monitor passed.
  • At the tip of the whole split, on 0ef148d, crush/crush-stretch.sh passed 9/9, including TEST_pool_create_stretch_replica.
  • That test creates a 2-zone pool without --zone_failure_domain, so on stretchy-C it needs mon/OSDMonitor: read default_crush_zone_failure_domain by its name #48.

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
    • 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
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

🤖 Generated with Claude Code

'osd pool create <pool> --num-zones 2' builds a stretch rule that takes
num_replica_per_zone (default 2) hosts in each zone, but
prepare_pool_size() ignored num_zones for a replicated pool created
without a size, so the pool got osd_pool_default_size (3) and one zone
held a single replica.

Use num_zones * num_replica_per_zone, and the matching default
min_size. Global stretch mode keeps mon_stretch_pool_size. Section
2.1.3 of the design says so.

TEST_pool_create_stretch_replica in crush-stretch.sh now expects size 4
and min_size 2 for a 2-zone pool; without the fix the pool gets size 3.

Assisted-by: Claude Code
@github-actions github-actions Bot added core documentation Improvements or additions to documentation mon tests labels Oct 7, 2026
@aainscow
aainscow marked this pull request as ready for review October 7, 2026 15:21
@aainscow
aainscow merged commit 09e3405 into stretchy-C Oct 7, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core documentation Improvements or additions to documentation mon tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant