mon: let the leader leave per-pool stretch mode with the other monitors #58
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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 #58"
general
weight: 0.35
Ericmzhang
<!--
- 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".
-->
This PR fixes a monitor defect in per-pool stretch mode. It came in with 59997c6c08e ("mon: add per-pool stretch mode capability") and exists only on stretchy-C, so there is no tracker.
The defect
When the last stretch pool is deleted, or set to
num_zones 1,MonmapMonitor::clear_stretch_mode_state()clears the leader'sstretch_mode_engagedwhile it prepares the change, before either map commits. When the monmap and the OSDMap have both left stretch mode, every monitor callsMonitor::try_disable_stretch_mode(). On the leader it returns at once, because the leader is no longer engaged. So the leader never resets itsdegraded_stretch_mode,recovering_stretch_modeandstretch_bucket_divider. The other monitors do reset them.If this happens in recovery stretch mode, the leader still believes the cluster is recovering:
ceph osd force_healthy_stretch_mode --yes-i-really-mean-itpasses its check on the leader and repliesTriggering healthy stretch modewith status 0, but does nothing. It should fail withthe cluster is not in recovery stretch mode, as it does on a cluster that was never in stretch mode.try_end_recovery_stretch_mode()on every PG digest.The fix
clear_stretch_mode_state()no longer touches the in-memory state. Every monitor, the leader included, leaves stretch mode throughtry_disable_stretch_mode()once both maps have committed, as withceph mon disable_stretch_mode. This was the first version of a86a2a3f67e ("mon: leave per-pool stretch mode in a single paxos round"). That commit kept the early disengage only to avoid changing thenum_zonescaller.This is safe because both maps commit in the same paxos round, so no monitor is engaged with only one map in stretch mode. Both callers keep paxos plugged while they call
clear_stretch_mode_state(), and both propose the OSDMap at once:_prepare_remove_pool()plugs paxos around the call and then callsforce_immediate_propose().prepare_command_pool_set()keeps paxos plugged throughout and setsneed_immediate_proposewhen the stretch mode changes.The function now asserts that paxos is plugged. The
num_zonesbranch further downprepare_command_pool_set()also calls it, but that branch cannot be reached.Global stretch mode (
ceph mon enable_stretch_mode) does not useclear_stretch_mode_state()and is unchanged.Commits
1.
qa/standalone/mon-stretch: demonstrate leaving stretch mode during recovery: a new test,mon-stretch-leave-in-recovery.sh. It takes a stretch EC pool into recovery stretch mode, leaves stretch mode by deleting the pool or by settingnum_zones 1, and checks thatforce_healthy_stretch_modethen fails on the same leader. Both cases fail on unmodified stretchy-C withTriggering healthy stretch mode.2.
mon: let the leader leave per-pool stretch mode with the other monitors: the fix.Testing
mon-stretch-leave-in-recovery.sh: both cases fail before the fix and pass after it. After the fix the leader's log showsDisabling stretch mode!together with the other monitors, and the command fails with EINVAL.qa/standalone/mon-stretchscripts pass, as does the pool-delete reproducer written for a86a2a3f67e (mon-stretch-pool-delete.sh, which is not on stretchy-C), run from a local copy.Contribution Guidelines
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
- [ ] References tracker ticket
- [x] Very recent bug; references commit where it was introduced
- [ ] New feature (ticket optional)
- [ ] Doc update (no ticket needed)
- [ ] Code cleanup (no ticket needed)
- [ ] Affects Dashboard, opened tracker ticket
- [ ] Affects Orchestrator, opened tracker ticket
- [x] No impact that needs to be tracked
- [ ] Updates relevant documentation
- [x] No doc update is appropriate
- [ ] Includes unit test(s)
- [ ] Includes integration test(s)
- [x] Includes bug reproducer
- [ ] No tests
<details>
<summary>Show available Jenkins commands</summary>
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.
</details>
🤖 Generated with Claude Code