Repository navigation
mon/OSDMonitor: fix the stretch mode a 2-zone pool create enables - #47
Merged
Merged
Conversation
…tch mode A replicated pool created in degraded stretch mode keeps its size and bucket target and gets the degraded bucket count and halved min_size that the existing stretch pools have, so the healthy transition restores it with them, as "mon/OSDMonitor: keep size and bucket target for a pool created in degraded stretch mode" (carried above) does. Say so in section 11.4.3. The stretch mode transitions never change peering_crush_bucket_target; only the bucket count and the mandatory member change. Correct the degraded and recovery rows of the EC example table in section 11.6 and its bucket_max note. Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
aainscow
force-pushed
the
wip-stretchy-C-pr43-04-stretch-from-create
branch
from
October 7, 2026 11:59
edc8020 to
3f08d21
Compare
…created Creating a pool with --num-zones 2 configures it through try_enable_stretch_mode(), which also wrote the cluster's stretch state and set degraded_stretch_mode to 0. With a zone down this ended degraded mode without the healthy transition: the other stretch pools kept a bucket count of 1 and the surviving zone as mandatory member, and the lost zone's monitor stayed in stretch_marked_down_mons, so it could never lead. If the other zone then failed, the remaining monitor and the tiebreaker could not form a quorum. Write the cluster's stretch state only when stretch mode is not already enabled. A pool joining a degraded stretch mode gets the degraded bucket count and the surviving mandatory member that the other pools have, so it can go active on the surviving zone and is restored with them. Section 11.4.2 of the design says that a 2-zone pool created while stretch mode is enabled configures only the new pool. TEST_ec_pool_create_in_degraded_stretch_mode in mon-stretch-ec-pool-create-degraded.sh creates a second stretch EC pool with one zone down. It checks that the new pool joins degraded stretch mode, with a bucket count of 1 and the surviving datacenter as its mandatory member, and that the cluster stays in degraded mode. It then brings the zone back, and checks that both pools are fully stretched again and that losing the other zone still leaves a quorum. Without the fix it fails at the first check. ec_stretch_cluster_without_dc2 in mon-stretch-helpers.sh, which sets the test up, now checks the result of its 'ceph osd down'. Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
…d every check
prepare_new_pool() committed monitor stretch mode before it validated
the pool's stretch settings. When that validation failed, for example
because the two datacenters differ in weight, or when a later check
failed, such as FastEC support for a multi-zone erasure pool, the
create failed but the monitors stayed in stretch mode with a tiebreaker
and connectivity elections.
Validate the monitor and pool stretch settings where they were, but
apply them at the end of prepare_new_pool(), after the remaining
checks. A failed create no longer leaves the monitors or the OSDMap in
stretch mode.
TEST_failed_stretch_pool_create_leaves_mons in
mon-stretch-failed-create-mons.sh makes a 2-zone EC create fail on the
weight check ("Failed to validate pool stretch mode") and expects the
monitors to stay out of stretch mode; it fails without the fix. A
later 'ceph osd set noout' orders the check after any monmap change
the failed create proposed. TEST_failed_stretch_pool_create_leaves_no_pool
in mon-stretch-failed-pool-create.sh covers the pool side of a failed
stretch create: a --num-zones 2 replicated create that fails because
stretch mode cannot be enabled for the monitors ("Failed to validate
monitor stretch mode"), after prepare_new_pool() has allocated the
pool, must leave the next pool create working. The create names the
existing replicated_rule, so it does not stop earlier at building a
stretch rule, which needs OSDs. That relies on "mon: Roll back
pending_inc on prepare_new_pool failure", carried from main: without
it, the next create aborts the monitor.
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
aainscow
force-pushed
the
wip-stretchy-C-pr43-04-stretch-from-create
branch
from
October 7, 2026 13:50
3f08d21 to
f165978
Compare
4 of 14 tasks
aainscow
marked this pull request as ready for review
October 7, 2026 14:01
This was referenced Oct 8, 2026
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.
Fourth PR split out of #43. It makes two fixes to the stretch mode that a
--num-zones 2pool create enables, and adds the design text for a pool created in degraded stretch mode.peering_crush_bucket_target, only the bucket count and the mandatory member.--num-zones 2create with a zone down went throughtry_enable_stretch_mode(), which resetdegraded_stretch_modeto 0. Degraded mode ended without the healthy transition. The other pools kept the degraded values, and the lost zone's monitor stayed marked down, so losing the other zone left no quorum.TEST_ec_pool_create_in_degraded_stretch_modeinmon-stretch-ec-pool-create-degraded.sh. Without the fix it fails at its first check.prepare_new_pool()committed monitor stretch mode before it validated the pool's stretch settings. A 2-zone create that failed a later check, such as unequal datacenter weights or FastEC support, left the monitors in stretch mode with a tiebreaker and connectivity elections.prepare_new_pool().TEST_failed_stretch_pool_create_leaves_monsinmon-stretch-failed-create-mons.sh, which fails without the fix, andTEST_failed_stretch_pool_create_leaves_no_poolinmon-stretch-failed-pool-create.sh, which relies on Jamie Pryde's rollback from mon: carry the stretch fixes proposed for main into stretchy-C #44.Testing
ninja -k 0 -j20built with no errors or warnings, andunittest_mon_monmappassed 4/4 andunittest_osd_monitorpassed 17/17.--num-zones 2create aborts the monitor. With PR 48 and this PR,mon-stretch-failed-create-mons.sh,mon-stretch-failed-pool-create.shandmon-stretch-ec-pool-create-degraded.shpassed.TEST_failed_stretch_pool_create_leaves_no_poolnames the existingreplicated_rule, so it reaches the monitor stretch mode check after the pool is allocated, instead of failing earlier while building the stretch rule.TEST_ec_pool_create_in_degraded_stretch_modechecks that the new pool joins degraded stretch mode.TEST_failed_stretch_pool_create_leaves_monsfailed: stretch mode was enabled. Without Jamie Pryde's rollback,TEST_failed_stretch_pool_create_leaves_no_poolfailed, with the monitor aborting inceph_assert(i != pool_name.end()).TEST_ec_pool_create_in_degraded_stretch_modefails at its first check without its fix, from when the test was written.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