Repository navigation
mon: do not ack osd new until cephx can auth as osd.N - #71248
Merged
Merged
Conversation
baum
requested review from
batrick and
tchaikov
and
a balanced review from Copilot
August 23, 2026 12:50
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an osd new race where acknowledgment could precede cephx state availability.
Changes:
- Applies Paxos state before waking commit waiters.
- Waits for Auth/KV commits when creating OSD credentials.
- Adds regression coverage and hardens vstart OSD formatting.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/vstart.sh |
Adjusts OSD mkfs handling and validation. |
src/mon/PaxosService.cc |
Reorders state application and waiter completion. |
src/mon/OSDMonitor.h |
Declares the OSD creation wait helper. |
src/mon/OSDMonitor.cc |
Waits for dependent Auth/KV state. |
qa/workunits/cephtool/test.sh |
Verifies credentials are readable after creation. |
qa/standalone/mon/osd-new-mkfs.sh |
Adds an immediate-mkfs regression test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
baum
force-pushed
the
wip-mon-osd-new-cephx-race
branch
from
August 23, 2026 16:01
06c7c13 to
03118c2
Compare
batrick
requested changes
Sep 9, 2026
tchaikov
reviewed
Sep 9, 2026
| # config: do_balance_cpu stores crimson_cpu_num/crimson_cpu_set | ||
| # only there, and get_early_config() aborts without them. | ||
| # osd new now waits until cephx can auth as osd.N, so Crimson | ||
| # talking to the mon is safe. Abort if mkfs wrote no type file. |
Contributor
Author
There was a problem hiding this comment.
yes, Kefu. 49e8a07 retried mkfs over this race. the mon now waits until KeyServer can serve osd.N, so the retry goes away. fail if type is missing instead of looping.
WDYT?
wait_for_commit used to run from PaxosService::refresh() before _update_from_paxos(), and OSDMAP refreshes before AUTH. After 53ea121 ("mon: use wait_for_commit to reply"), osd new could ack while KeyServer still lacked osd.N. handle_auth_request() serves KeyServer on the msgr path without mon.lock. Complete waiters in post_refresh() instead, after every service has run _update_from_paxos(). Replies are slightly later than refresh() but still earlier than wait_for_finished_proposal (_active()). Signed-off-by: Alexander Indenbaum <[email protected]>
baum
force-pushed
the
wip-mon-osd-new-cephx-race
branch
from
September 9, 2026 12:25
03118c2 to
91e4212
Compare
batrick
requested changes
Sep 15, 2026
wait_for_commit now completes in post_refresh(), so osd new's existing OSDMonitor wait is enough: KeyServer has applied the plugged auth incremental before the ack. That race wedged ceph-nvmeof vstart CI: osd.2 mkfs authenticated 14ms before auth vN applied, failed with EACCES, wrote no type file, and vstart still started the OSD. - standalone + cephtool: osd new then immediate auth get / mkfs - vstart: abort if mkfs wrote no type file; drop the 49e8a07 retry that only hid the window Signed-off-by: Alexander Indenbaum <[email protected]>
baum
force-pushed
the
wip-mon-osd-new-cephx-race
branch
from
September 18, 2026 09:39
813be53 to
6919d34
Compare
batrick
approved these changes
Sep 18, 2026
Contributor
|
This PR has been added to wip-bharath17-testing-20260919.063401-main. |
This was referenced Sep 22, 2026
6 of 14 tasks
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.
mon: do not ack osd new until cephx can auth as osd.N
Until PR #50503 (“mon: use wait_for_commit to reply”), osd new used wait_for_finished_proposal.
osd newmutates AuthMonitor (and KVMonitor for lockbox) in the same plugged Paxos transaction as the osdmap update, but the client waited on OSDMonitor::wait_for_commit. PaxosService::refresh also woke waiting_for_commit before _update_from_paxos(). With refresh order OSDMAP then AUTH, the command could return while KeyServer still lacked osd.N.That race wedged ceph-nvmeof vstart CI: osd.2 mkfs authenticated 14ms before auth vN applied, failed with EACCES, wrote no
typefile, and vstart still started the OSD.Seen in:
https://github.com/ceph/ceph-nvmeof/actions/runs/32452671723/job/97162876156 (pytest multi_gateway, tentacle_9.2, sha d7e3a1c)
Same-run sibling that got a healthy cluster:
https://github.com/ceph/ceph-nvmeof/actions/runs/32452671723/job/97162876249
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.