mon/OSDMonitor: apply stretch transitions to pending pool changes #59
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 #59"
general
weight: 0.35
kamoltat
<!--
- 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".
-->
A degraded, recovery or healthy stretch mode transition rewrites the peering state of every stretch pool in the
pending OSDMap incremental. It only looked at pools that are stretched in the committed map, and decided by their
committed bucket count. Pool creates and
osd pool setcommands prepared into the same incremental, about onepaxos_propose_intervalbefore a zone fails or recovers, were therefore missed or overwritten. Found by readingthe code while reviewing https://github.com/aainscow/ceph/pull/47.
| Pending pool change | Transition | Before this PR |
| --- | --- | --- |
| two-zone create, or
osd pool set num_zones 2| degraded | keeps bucket count 2 and no mandatory member: its PGs stay inactive until the other zone returns || pool created from the degraded map | healthy | keeps bucket count 1 and the old mandatory member: its PGs can go active in one zone of a healthy cluster |
| the same | recovery | misses
set_last_force_op_resend()||
osd pool set num_zones 1on a stretch pool | any | gets a bucket count and mandatory member back on top of the unstretch || pool deletion | any | gets a
new_poolsentry |The pool deletion entry is harmless:
OSDMap::apply_incremental()appliesnew_poolsbefore it erasesold_pools, andscan_for_creating_pgs()skipsold_pools. The unstretch case is real: the unit test shows thepending num_zones 1 pool coming back with bucket count 1 and the surviving zone as mandatory member.
Commits
1. mon/OSDMonitor: share the pool update of the stretch transitions moves the loop that the three
transitions shared into the static
OSDMonitor::apply_stretch_transition_to_pools(), so that unit tests cancall it. No change in behaviour.
2. test/mon: demonstrate stretch transitions missing pending pool changes adds
OSDMonitorStretchTransitionTesttounittest_osd_monitor, with each of the pending changes above. Allthree tests fail on commit 1.
3. mon/OSDMonitor: apply stretch transitions to pending pool changes makes the helper decide by the pending
copy of each pool. It updates the stretch pools in
new_pools(creates andnum_zones 2included), then thecommitted stretch pools that have no pending copy, and skips pools in
old_pools.What this does not change
A transition cannot then overwrite that with the committed
stretch_mode_enabled:MonmapMonitor::clear_stretch_mode_state()clearsMonitor::stretch_mode_engagedat once, and everyMonitorentry point to the three transitions, including the retry contexts, returns early whenis_stretch_mode()is false.osd pool set num_zones 2paths still copy the stretchstate from the committed
osdmap, not frompending_inc. That covers the global stretch mode branch ofprepare_new_pool()withdegraded_stretch_mandatory_member(), and the per-pool branch oftry_enable_stretch_mode(). With this PR, I know of no window where that is wrong: each transition callspropose_pending()itself, and a command that arrives later waits for that commit, becauseis_writeable()needs a pending incremental. Reading the pending state would remove the dependence on thatordering. That belongs with the ongoing rework of
enable_stretch_modeand of the pool defaults, so it isleft for it.
Testing
unittest_osd_monitor: the three new tests fail on commit 1 (log excerpt below) and pass with commit 3; all 20tests pass.
unittest_osdmap(the other test that includesmon/OSDMonitor.h): 46 tests pass.-Wall -Wextra: no warnings.-
mon-stretch-pool-create-degraded.shandmon-stretch-ec-pool-create-degraded.sh, which go through thedegraded, recovery and healthy transitions with a pool created while degraded;
-
mon-stretch-fail-recovery.shandcrush/crush-stretch.sh;- the other
qa/standalone/mon-stretchsuites:mon-stretch-commands.sh,mon-stretch-failed-create-mons.sh,mon-stretch-failed-pool-create.sh,mon-stretch-pool-create-default-profile.sh,mon-stretch-pool-create-positional.sh,mon-stretch-replicated-placement-options.sh,mon-stretch-uneven-crush-weights.shandosd-pool-set-replica.sh.<details>
<summary>The new tests on commit 1</summary>
</details>
Contribution Guidelines
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
- [ ] References tracker ticket
- [ ] Very recent bug; references commit where it was introduced
- [ ] New feature (ticket optional)
- [ ] Doc update (no ticket needed)
- [x] 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
- [x] 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