Repository navigation
qa/suites: serialize mgr key rotation in rotate-keys task - #72361
Conversation
|
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 |
8432b0b to
8497260
Compare
kginonredhat
left a comment
There was a problem hiding this comment.
The mgr ordering is right, but the failover wait can still rotate the second key before a mgr is available, which is the hang this task is trying to stop.
After ceph mgr fail, wait until ceph mgr stat shows available == true and active_name equal to the rotated standby. active_name != the old mgr is already true when mgr fail returns, and it is also true when the name is empty or null. The sleep 60 does not check that the new mgr is serving.
Wait until the old active mgr is back in ceph mgr dump .standbys[] before calling rotate_and_redeploy on it. Rotating its key first, then calling ceph orch ps with no timeout, can leave no mgr up.
Treat a redeploy as finished only when started is non-empty and different from the saved value. An empty string or null from a failed ceph orch ps currently ends the loop.
Check the daemon status from JSON (status == 1) for more than one poll. grep running is a substring match and can pass on a single sample during a crash loop.
Replace the unbounded key while loop with one comparison after ceph auth rotate. get-key reads the monitor, so the loop does not show that the daemon loaded the new key, and it can sleep forever.
Change the comment on ceph mgr fail so it says the active mgr is failed and the rotated standby takes over.
848524c to
ee36394
Compare
Rotating both mgr keys back-to-back can leave both mgr daemons restarting at the same time. When that race hits, both daemons may fail cephx auth and crash-loop, leaving no active mgr and causing ceph orch commands to hang. Rework the task flow to rotate OSDs first, then rotate only the standby mgr, wait until it is running, force failover, and rotate the new standby. This serializes mgr redeploys and closes the window where both mgrs are down. Fixes: https://tracker.ceph.com/issues/81386 Signed-off-by: Yonatan Zaken <[email protected]>
ee36394 to
ec30e78
Compare
Done
Done, checking both active and standby after failover were swapped
Done, checking both active and standby after failover were swapped
I am ok with the loop exiting even if the string is empty, it's just a mechanism to track that something was changed. After that we wait for the daemon to be in running state.
Keeping one poll should be enough. But I did change to read the status_desc from the JSON output for more robustness over the grep. I chose status_desc == running over status just cause it's more readable that status == 1.
Done, added timeout on the key change check.
Done Tested a script execution with the latest changes on a deployed ceph cluster on my workstation. |
rkachach
left a comment
There was a problem hiding this comment.
Overall LGTM. Just a minor comment.
|
Teuthology run was successful. Failing Test cases are not related to this PR: |
Rotating both mgr keys back-to-back can leave both mgr daemons restarting at the same time. When that race hits, both daemons may fail cephx auth and crash-loop, leaving no active mgr and causing ceph orch commands to hang.
Rework the task flow to rotate OSDs first, then rotate only the standby mgr, wait until it is running, force failover, and rotate the new standby. This serializes mgr redeploys and closes the window where both mgrs are down.
Fixes: https://tracker.ceph.com/issues/81386
Sequence of event from log output
Script fires ceph orch daemon redeploy mgr.x right after, while mgr.y had just been redeployed/was still settling (only 5s + a "ps --refresh" gap, not full 60s, before moving to the next entity.
Redeploying the active mgr while standby's key was just rotated too races the mgr failover with key/keyring regeneration on disk.
Journal shows both mgr.y and mgr.x repeatedly: Control process exited, code=exited, status=1/FAILURE → new container fails immediately, eventually Start request repeated too
quickly → unit stays failed, no more retries.
No mgr ever comes back up → orchestrator module in teardown blocks indefinitely, there's no active mgr to route the command:
As seen in log this command never returns until we hit max job timeout ~6 hours later.
Conclusion:
The test does not wait long enough / does not verify mgr daemon is actually running before moving to redeploy the second mgr — both mgrs restart too close together.
Testing
Executed the updated script on a local Ceph cluster, looks OK.
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.