Repository navigation
ceph-crash: fix the auth name fallback and add tests for it - #72674
Merged
Merged
Conversation
5 of 14 tasks
tchaikov
force-pushed
the
wip-ceph-crash-ping-auth-names
branch
2 times, most recently
from
October 16, 2026 02:48
b00e8e7 to
fd6ea9e
Compare
tchaikov
force-pushed
the
wip-ceph-crash-ping-auth-names
branch
from
October 16, 2026 03:03
fd6ea9e to
629fe07
Compare
Since 3a0f9ee, post_crash() moves on to the next auth name only if ceph exits with EACCES, assuming a missing key fails that way. But a name without a keyring fails with EPERM, and a name the mon has no key for may hang until timeout(1) kills it. EACCES only means the mon rejected the key. So without a keyring for client.crash.<host>, ceph-crash gives up after the first name and never posts the crash. rados/singleton/all/test-crash fails this way on every run. Try the next name after any error, including a timeout, but stop if ceph exits 0 and still reports a failure (see a77b47e), or exits with EINVAL, as no other name helps then. Return 1 in the former case, so scrape_path() keeps the dump instead of moving it to posted/. Stderr lines starting with a timestamp are log messages, like the librados warning about experimental features, so do not take them as a failure. Pass an empty --log-stderr-prefix, so that a log_stderr_prefix set in the config does not hide the timestamp. If all names fail, log the error of each. Move the loop into a helper for the startup ping, and decode stderr with errors='replace'. Fixes: 3a0f9ee Fixes: https://tracker.ceph.com/issues/76470 Signed-off-by: Kefu Chai <[email protected]>
84c4562 added a "ceph -s" at startup, so that after a key rotation ceph-crash uses its new key right away and the mon commits the pending key. But the ping does not pass -n, so it authenticates as client.admin. It fails when ceph-crash runs as the ceph user and cannot read the admin keyring, and when it works, it does not touch the crash key. Ping with the same auth names as post_crash(), and discard the output, as the cluster status is of no use in the ceph-crash log. Signed-off-by: Kefu Chai <[email protected]>
tchaikov
force-pushed
the
wip-ceph-crash-ping-auth-names
branch
2 times, most recently
from
October 16, 2026 03:33
e0f4149 to
78ede4e
Compare
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Nothing tested post_crash(), so the regression from 3a0f9ee went unnoticed until the rados/singleton test-crash job stopped posting crashes. Load ceph-crash.in as a module and replace subprocess.Popen with a fake that returns a canned result per auth name: exit 1 for a missing key, 13 for a rejected key, 124 for a timeout, 22 for a rejected dump, and exit 0 with either a failure report or a log line on stderr. The tests check which names post_crash() tries, and that scrape_path() moves a dump to posted/ only after a successful post, since a moved dump is never retried. Register the test under NOT WIN32, as ceph-crash.in imports grp and pwd. Assisted-by: Claude Code Signed-off-by: Kefu Chai <[email protected]>
A name the monitors have no key for does not fail fast. The client keeps hunting for monitors until timeout(1) kills it after 30 seconds. With three names, that is 90 seconds for the startup ping and for each crash dump, longer than rados/singleton/all/test-crash waits after restarting ceph-crash. Pass --connect-timeout 5, and keep the 30-second timeout(1) for a command that hangs after connecting. Signed-off-by: Kefu Chai <[email protected]>
run_ceph() always starts from the first name. On a host where only client.admin has a key, every crash dump waits for the two names before it to fail, 10 seconds with the connect timeout, although the startup ping already found the name that works. Remember that name and try it first. If it stops working, the other names are still tried in their usual order. Signed-off-by: Kefu Chai <[email protected]>
tchaikov
force-pushed
the
wip-ceph-crash-ping-auth-names
branch
from
October 16, 2026 03:49
78ede4e to
4f56f35
Compare
aainscow
self-requested a review
October 16, 2026 08:19
rzarzynski
approved these changes
Oct 21, 2026
4 of 14 tasks
Contributor
|
This PR has been added to wip-bharath11-testing-20261027.070430-main. |
4 of 14 tasks
Member
|
Needs backport to umbrella and Tentacle |
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.
Since 3a0f9ee, ceph-crash gives up on the first auth name unless it fails with EACCES. But a name without a keyring fails with EPERM, so a host without a keyring for
client.crash.<host>never posts its crashes. rados/singleton/all/test-crash fails this way on every run, see https://tracker.ceph.com/issues/76470.With this change, ceph-crash tries the next name after any error, and only stops early if the command itself failed or the cluster rejected the dump. The startup ping uses the same names instead of client.admin.
--connect-timeout 5makes a name the monitors don't know fail within 5 seconds instead of waiting for the 30stimeout(1), and the name that worked last is tried first.post_crash()andscrape_path()are now covered by unit tests, withsubprocess.Popenmocked.Fixes: https://tracker.ceph.com/issues/76470
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.