Repository navigation
mgr/cephadm: wait after an OSD restart before restarting the next - #74801
Open
yasser-rafid wants to merge 1 commit into
Open
yasser-rafid wants to merge 1 commit into
yasser-rafid wants to merge 1 commit into
Conversation
When a spec change makes cephadm redeploy or reconfigure OSDs, it checks `osd ok-to-stop` before each one, but in the same serve loop it checks the next OSD a few seconds after restarting the previous one. The mgr's PG stats do not show that restart yet, so the check counts the restarted OSD as a live copy and can pass. Two OSDs of the same PGs are then down at once and PGs go down. Record when cephadm last restarted, stopped or started an OSD, in _daemon_action after the action returns, so upgrades, `ceph orch daemon` actions and _check_daemons all count and a slow redeploy does not use up the wait. An autonomous OSD action within osd_restart_settle_time (default 30s, 0 disables) of that is deferred without asking ok-to-stop. A deferred action, or a not-ok-to-stop answer within 5 minutes of a restart by cephadm, makes the serve loop sleep for the settle time instead of the full interval, so OSDs no longer wait about 10 minutes each to be retried. Fixes: https://tracker.ceph.com/issues/81929 Signed-off-by: Yasser Rafid <[email protected]>
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
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.
Fixes: https://tracker.ceph.com/issues/81929
When a spec change makes cephadm redeploy or reconfigure OSDs,
_check_daemonsrunsosd ok-to-stopbefore each one. In the same serve loop, it checks the next OSD a few seconds after restarting the previous one. The mgr's PG stats don't show that restart yet, so the check counts the restarted OSD as a live copy and can pass. Two OSDs of the same PGs then go down at once. The tracker issue shows PGs down for 4 to 6 seconds.Change
CephadmOrchestrator._daemon_actionrecords when cephadm last restarted, stopped or started an OSD. It records the time after the action returns, or after it fails. Upgrades,ceph orch daemon …and_check_daemonsall go through it, and a slow redeploy doesn't use up the wait._check_daemonsdefers an autonomous OSD redeploy or reconfig that comes withinosd_restart_settle_timeof the last restart, without asking ok-to-stop. User-scheduled actions skip ok-to-stop, as before.mgr/cephadm/osd_restart_settle_time: default 30 s, and 0 disables the wait. Its description is in the option itself (ceph config help mgr/cephadm/osd_restart_settle_time). I can add a doc commit if reviewers want one.With the defaults, cephadm restarts at most about one OSD per 30 s during a spec change. That is slower than before, but it no longer takes PGs down.
Not in this PR
osd ok-to-stop Nlooks only at the PGs whose last acting OSD is N. That makes the check weaker too, but it is a separate fix in the mon/OSD code.Testing
cephadm/tests/test_cephadm.pycover:0disabling the wait;cephadm/testsrun locally: no new failures compared withmain.flake8is clean.AI assistance
Claude Code (claude-opus-5-5) was used while writing this change. I reviewed and tested it.
Contribution Guidelines
Checklist