Repository navigation
Conversation
The state machine in Section 11.3 entered stretch mode with enable_stretch_mode and left it only from Healthy with disable_stretch_mode. Per-pool stretch mode does neither: - the first pool given num_zones 2, at creation or with 'osd pool set num_zones 2', enables it; - deleting the last stretch pool or setting it to num_zones 1 disables it, from Healthy, Degraded or Recovery. Describe what entering and leaving change in the MonMap (tiebreaker, disallowed leaders, election strategy) and the OSDMap, the degraded, recovery and healthy transitions, and how global stretch mode differs. 'mon disable_stretch_mode' only leaves global stretch mode and is refused in Recovery. Ask reviewers whether leaving in Degraded or Recovery should be refused, whether entering should commit the MonMap with the pool, and whether a later pool's zone failure domain should be checked. Drop the statements that contradict the code: the prerequisite and the pool creation gate that require stretch mode to be enabled before a num_zones 2 pool is created, and the note that a pool created after 'mon enable_stretch_mode' in degraded mode gets no mandatory member. Assisted-by: Claude Code
aainscow
added a commit
that referenced
this pull request
Oct 9, 2026
Folds the still-current parts of #57 ("doc/dev: ec_stretch_cluster: describe entering and leaving stretch mode") into this design, as the owner asked, so that #57 can be closed: - 11.3.1 Entering Stretch Mode: what is checked, what changes in the MonMap, the OSDMap and the pool, and how the Paxos rounds of osd pool set and osd pool create differ. - 11.3.2 Degraded, Recovery and Healthy, in detail. - 11.3.3 Leaving Stretch Mode through pool delete, num_zones 1 or disable_stretch_mode, and that the first two leave from any state. - The open questions on leaving in Degraded or Recovery, and on a MonMap left in stretch mode with no stretch pool. Left out because this design replaces it: #57's Section 11.3.4 on global stretch mode, the global_stretch_mode_enabled flag, and the reset of a pool to osd_pool_default_size. #57's question whether a later pool's zone type is checked against stretch_mode_bucket is answered here: it is, at creation and at num_zones 2. 11.4.2 now refers to 11.3.1 and 11.3.3 rather than repeating them. To be squashed into "doc/dev: ec_stretch_cluster: refactor global stretch mode" before merge. Assisted-by: Claude Code
aainscow
added a commit
that referenced
this pull request
Oct 9, 2026
ceph osd pool create already refuses a new two-zone pool, while stretch mode is enabled, unless its rule covers the same zone buckets of the stretch mode zone type as the other stretch pools (validate_stretch_mode_new_pool). ceph osd pool set <pool> num_zones 2 did not check this, so a pool could join stretch mode across other buckets or another zone type. Both now make the same check, as the design says in Section 11.3.1. The owner asked for this while folding #57 into this PR: #57 asked whether a later pool's zone type is checked against stretch mode. Test: TEST_stretch_diff_sites in crush-stretch.sh, which refuses pool create with a rule over other zone buckets, now also refuses num_zones 2 with that rule. To be squashed into "mon: replace global stretch mode with per-pool num_zones commands" before merge. Assisted-by: Claude Code
Owner
Author
|
Folded into #54 by f850beb, updated for the global stretch mode refactor: Sections 11.3.1–11.3.3 and the two open questions on leaving in Degraded/Recovery and on a MonMap left in stretch mode. Section 11.3.4 is not carried over, because #54 replaces global stretch mode. The question on checking a later pool's zone type is answered in #54: it is checked at creation and at |
5 of 14 tasks
aainscow
added a commit
that referenced
this pull request
Oct 13, 2026
Folds the still-current parts of #57 ("doc/dev: ec_stretch_cluster: describe entering and leaving stretch mode") into this design, as the owner asked, so that #57 can be closed: - 11.3.1 Entering Stretch Mode: what is checked, what changes in the MonMap, the OSDMap and the pool, and how the Paxos rounds of osd pool set and osd pool create differ. - 11.3.2 Degraded, Recovery and Healthy, in detail. - 11.3.3 Leaving Stretch Mode through pool delete, num_zones 1 or disable_stretch_mode, and that the first two leave from any state. - The open questions on leaving in Degraded or Recovery, and on a MonMap left in stretch mode with no stretch pool. Left out because this design replaces it: #57's Section 11.3.4 on global stretch mode, the global_stretch_mode_enabled flag, and the reset of a pool to osd_pool_default_size. #57's question whether a later pool's zone type is checked against stretch_mode_bucket is answered here: it is, at creation and at num_zones 2. 11.4.2 now refers to 11.3.1 and 11.3.3 rather than repeating them. To be squashed into "doc/dev: ec_stretch_cluster: refactor global stretch mode" before merge. Assisted-by: Claude Code
aainscow
added a commit
that referenced
this pull request
Oct 13, 2026
ceph osd pool create already refuses a new two-zone pool, while stretch mode is enabled, unless its rule covers the same zone buckets of the stretch mode zone type as the other stretch pools (validate_stretch_mode_new_pool). ceph osd pool set <pool> num_zones 2 did not check this, so a pool could join stretch mode across other buckets or another zone type. Both now make the same check, as the design says in Section 11.3.1. The owner asked for this while folding #57 into this PR: #57 asked whether a later pool's zone type is checked against stretch mode. Test: TEST_stretch_diff_sites in crush-stretch.sh, which refuses pool create with a rule over other zone buckets, now also refuses num_zones 2 with that rule. To be squashed into "mon: replace global stretch mode with per-pool num_zones commands" before merge. Assisted-by: Claude Code
aainscow
added a commit
that referenced
this pull request
Oct 13, 2026
Folds the still-current parts of #57 ("doc/dev: ec_stretch_cluster: describe entering and leaving stretch mode") into this design, as the owner asked, so that #57 can be closed: - 11.3.1 Entering Stretch Mode: what is checked, what changes in the MonMap, the OSDMap and the pool, and how the Paxos rounds of osd pool set and osd pool create differ. - 11.3.2 Degraded, Recovery and Healthy, in detail. - 11.3.3 Leaving Stretch Mode through pool delete, num_zones 1 or disable_stretch_mode, and that the first two leave from any state. - The open questions on leaving in Degraded or Recovery, and on a MonMap left in stretch mode with no stretch pool. Left out because this design replaces it: #57's Section 11.3.4 on global stretch mode, the global_stretch_mode_enabled flag, and the reset of a pool to osd_pool_default_size. #57's question whether a later pool's zone type is checked against stretch_mode_bucket is answered here: it is, at creation and at num_zones 2. 11.4.2 now refers to 11.3.1 and 11.3.3 rather than repeating them. To be squashed into "doc/dev: ec_stretch_cluster: refactor global stretch mode" before merge. Assisted-by: Claude Code
aainscow
added a commit
that referenced
this pull request
Oct 13, 2026
ceph osd pool create already refuses a new two-zone pool, while stretch mode is enabled, unless its rule covers the same zone buckets of the stretch mode zone type as the other stretch pools (validate_stretch_mode_new_pool). ceph osd pool set <pool> num_zones 2 did not check this, so a pool could join stretch mode across other buckets or another zone type. Both now make the same check, as the design says in Section 11.3.1. The owner asked for this while folding #57 into this PR: #57 asked whether a later pool's zone type is checked against stretch mode. Test: TEST_stretch_diff_sites in crush-stretch.sh, which refuses pool create with a rule over other zone buckets, now also refuses num_zones 2 with that rule. To be squashed into "mon: replace global stretch mode with per-pool num_zones commands" before merge. Assisted-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stretch mode state machine in the EC stretch cluster design doc (Section 11.3) entered stretch mode only with
enable_stretch_modeand left it only from Healthy withdisable_stretch_mode. That is global stretch mode. Pools with--num_zones 2use per-pool stretch mode, which works differently on stretchy-C. This PR updates Section 11.3 to describe the code as it is, and asks reviewers to decide the open questions below. No code changes.What the section now says:
num_zones = 2(osd pool create ... --num_zones 2orosd pool set <pool> num_zones 2) enables stretch mode. It lists:stretch_mode_enabled;peering_crush_*fields._prepare_remove_pool->is_last_stretch_pool()->clear_stretch_mode_state(), a86a2a3) or setting it tonum_zones 1(a1dbca8, 1e62a12) disables stretch mode from any state: Healthy, Degraded or Recovery. This:tiebreaker_mon, every disallowed leader (including ones added withceph mon add disallowed_leader) andstretch_marked_down_mons, and leaves the election strategy at connectivity;ceph mon enable_stretch_modeanddisable_stretch_mode.num_zonescannot change, deleting pools never leaves stretch mode, anddisable_stretch_modeis the only exit. It is refused outside global stretch mode, and refused in Recovery but not in Degraded.num_zones = 2pool now enables stretch mode);mon enable_stretch_modein degraded mode gets no mandatory member (prepare_new_poolsets it).Questions for reviewers
The doc describes the behaviour as it is and records these as open questions (Section 11.3.3):
Leaving stretch mode while Degraded or Recovery. Deleting the last stretch pool, or setting it to
num_zones 1, clears the degraded and recovering flags andstretch_marked_down_monswithout a transition to Healthy, while the failed zone may still be down.ceph mon disable_stretch_modeis refused in Recovery. Should the per-pool exits be refused (or deferred) in Degraded or Recovery too, or is leaving at once intended, because no stretch pool is left to protect? This was first raised in mon, qa: fix the rados:thrash-erasure-code-stretch failures #52.Entering can leave the MonMap in stretch mode with no stretch pool. This is from reading the code; it was not run.
osd pool set <pool> num_zones 2stages the MonMap change before it checks the zone weights, so a refusal for uneven weights still commits the MonMap change.osd pool create --num_zones 2proposes the MonMap change in its own Paxos round. If the client does not resend the command after the election, the pool is never created.Should both commit the MonMap change only with the pool, in one round, as pool delete does since a86a2a3?
A later pool's zone failure domain is checked to split the cluster into two zones, but not against the OSDMap's
stretch_mode_bucket, as it is in global stretch mode (validate_stretch_mode_new_pool). Should it be?Checks
rst2html, with.. code::standing in for the Sphinxmermaidandditaadirectives): the same four messages before and after this change: two Sphinx-only roles, theditaastand-in, and an existing list warning in Section 14. None is in Section 11.mermaid.parse()under jsdom): the new state diagram and the three existing sequence diagrams parse. A deliberately broken diagram is rejected.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
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.
🤖 Generated with Claude Code