Repository navigation
mgr/DaemonServer: move mark_finish_mon_command into ReplyOnFinish::finish() - #73120
Open
stzuraski898 wants to merge 1 commit into
Open
stzuraski898 wants to merge 1 commit into
stzuraski898 wants to merge 1 commit into
Conversation
NitzanMordhai
approved these changes
Nov 2, 2026
NitzanMordhai
left a comment
Contributor
There was a problem hiding this comment.
@stzuraski898, please mention the other PR that changes mark_finish_mon_command since both of them need to be addressed together
Contributor
Author
|
jenkins test api |
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check arm64 |
…nish() ReplyOnFinish::ReplyOnFinish() previously called mark_finish_mon_command() in the constructor body, which runs as soon as the Context is allocated -- before monc dispatches the command and before any mon reply is received. This caused the op-tracker to report "mon command finished" for ops that were still waiting on the mon (e.g. during a mon election). Move the call into ReplyOnFinish::finish(), which is invoked by MonClient when the mon reply arrives, so the finish flag is set only after the command has actually completed. The same change is also part of ceph#72357 (main commit "mgr: fix MgrOpRequest mon-command flag tracking", tracked as https://tracker.ceph.com/issues/81340), which additionally fixes mark_finish_mon_command() passing flag_start_mon_command instead of flag_finish_mon_command. The two PRs are related and should be fixed in tandem. Fixes: https://tracker.ceph.com/issues/82136 Assisted-by: Claude Opus 4.8 Signed-off-by: Steven Zuraski <[email protected]>
stzuraski898
added a commit
to stzuraski898/ceph
that referenced
this pull request
Nov 2, 2026
mark_finish_mon_command() was passing flag_start_mon_command to mark_flag_point() — a copy-paste error. The finish flag (1 << 4) was never set; dump_ops_in_flight always showed "start mon command" regardless of whether the mon had replied. ReplyOnFinish also called op->mark_finish_mon_command() in its constructor, before monc->start_mon_command() dispatched the command. dump_ops_in_flight therefore reported "mon command finished" for ops still waiting on the mon (e.g. during an election). Move the call into ReplyOnFinish::finish() so the flag advances only when the mon has actually replied. The ReplyOnFinish change in DaemonServer.cc is the same change made by ceph#73120 (main commit "mgr/DaemonServer: move mark_finish_mon_command into ReplyOnFinish::finish()", tracked as https://tracker.ceph.com/issues/82136). The two PRs are related and should be fixed in tandem. Fixes: https://tracker.ceph.com/issues/81340 Assisted-by: IBM Bob Signed-off-by: Steven Zuraski <[email protected]>
stzuraski898
force-pushed
the
wip-sz-82136-daemonserver-mark-finish-timing
branch
from
November 2, 2026 21:26
8fe05f0 to
337684b
Compare
stzuraski898
added a commit
to stzuraski898/ceph
that referenced
this pull request
Nov 9, 2026
mark_finish_mon_command() was passing flag_start_mon_command to mark_flag_point() — a copy-paste error. The finish flag (1 << 4) was never set; dump_ops_in_flight always showed "start mon command" regardless of whether the mon had replied. ReplyOnFinish also called op->mark_finish_mon_command() in its constructor, before monc->start_mon_command() dispatched the command. dump_ops_in_flight therefore reported "mon command finished" for ops still waiting on the mon (e.g. during an election). Move the call into ReplyOnFinish::finish() so the flag advances only when the mon has actually replied. The ReplyOnFinish change in DaemonServer.cc is the same change made by ceph#73120 (main commit "mgr/DaemonServer: move mark_finish_mon_command into ReplyOnFinish::finish()", tracked as https://tracker.ceph.com/issues/82136). The two PRs are related and should be fixed in tandem. Fixes: https://tracker.ceph.com/issues/81340 Assisted-by: IBM Bob Signed-off-by: Steven Zuraski <[email protected]>
Contributor
Author
Contributor
Contributor
Author
|
jenkins test api |
Contributor
Author
|
jenkins test windows |
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check arm64 |
Contributor
Author
|
jenkins test signed |
Contributor
Author
|
jenkins test submodules |
Contributor
Author
|
jenkins make check |
Contributor
|
This PR has been added to wip-bharath29-testing-20261121.045602-main. |
Contributor
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.
Summary
ReplyOnFinish::ReplyOnFinish() called op->mark_finish_mon_command() in its constructor body. The constructor runs as soon as the Context is allocated, before monc dispatches the command and before any mon reply arrives. The op-tracker therefore reported "mon command finished" for ops that were still waiting on the mon, for example during a mon election.
Fix
Remove the call from the constructor and make it the first step of ReplyOnFinish::finish(). MonClient invokes finish() when the mon reply arrives, so the finish flag is now set only after the command has completed. The if (op) guard is kept. Nothing else in finish() changes: it still claims from_mon into cmdctx->odata and calls cmdctx->reply(r, outs).
The change is 4 insertions and 5 deletions in src/mgr/DaemonServer.cc.
Impact / likelihood
This is an observability bug, not a functional one. The command path and the reply to the client are unchanged. Only the timing of the op-tracker's "finished mon command" event moves, from before dispatch to reply receipt. It matters when the mon is slow or unavailable, because the old code recorded a finish time for a command that had not run. This affects the reported timing and op-tracker output, such as dump_ops_in_flight and slow-op diagnostics, for these commands.
Fixes: https://tracker.ceph.com/issues/82136
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.