Repository navigation
mgr: erase daemon_connections ref on reset for all peer types - #70367
Conversation
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
16 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
ok to test |
|
This PR has been added to wip-bharath8-testing-20260721.232151-main. |
|
I can confirm this has fixed the issue for us. |
Fixes a slow memory leak that didn't make it's way into the .3 release References: ceph/ceph#70367 Upstream-ref: ceph/ceph@e1edb48
|
@Sunnatillo @NitzanMordhai -Testing is complete. Once the review is finished, feel free to merge. If a rerun is needed, add the |
NitzanMordhai
left a comment
There was a problem hiding this comment.
@Sunnatillo, other than the debugging message request, all looks good
…types handle_open() stores a strong ConnectionRef in daemon_connections for every non-client daemon (mon, mds, osd), but ms_handle_reset() erased it only for OSD peers. Any non-OSD daemon connection that ended without an explicit MMgrClose (idle timeout, network drop, daemon crash) left a permanent ConnectionRef behind. That leaked one AsyncConnection per reconnect cycle and caused unbounded ceph-mgr RSS growth. Erase daemon_connections unconditionally on reset while keeping osd_cons cleanup under the OSD peer-type guard. Fixes: https://tracker.ceph.com/issues/78408 Signed-off-by: Sunnatillo <[email protected]>
e1edb48 to
a996144
Compare
This PR fixes the problem below:
ceph-mgrexhibits a slow, roughly linear RSS increase (~1–2 MiB/hour) that neverplateaus. On a long-running cluster this grows without bound until the mgr is
restarted or OOM-killed.
How we tracked it down
We approached this as an elimination-based investigation rather than guessing at a
fix, narrowing the cause step by step:
totals tracked RSS closely over many hours.
--basediffs across profilesattributed ~100% of the growth to
AsyncConnectionobjects allocated on theinbound-accept path (
AsyncMessenger::add_accept) of the mgr server messenger.conns,anon_conns,accepting_conns,and
deleted_connswere all dumped and shown to be bounded and oscillating — theydrain, so they can't explain monotonic growth. (
deleted_connsis reap-thresholdgated; the
accepting_connsanon double-membership is a separate bounded smell.)_stop(),cleanup(), and the destructors were probed.cleanup()ran 1:1 with_stop()forthe leaked cohort, yet those connections were never destroyed — ruling out lost
clean-up events and the handler refs themselves.
cleanup(). The leakedAsyncConnections were stopped, cleaned, and removed from every messenger set, butstill alive — so a
ConnectionRefwas outliving teardown somewhere above themessenger layer.
Root cause
handle_open()stores a strongConnectionRefindaemon_connectionsfor everynon-client daemon (mon, mds, osd), but
ms_handle_reset()erased it only for OSD peers.Any non-OSD daemon connection that ended without an explicit
MMgrClose(idle timeout,network drop, daemon crash) left a permanent
ConnectionRefbehind. That leaked oneAsyncConnectionper reconnect cycle and caused unbounded ceph-mgr RSS growth.The reset handler delivers for lossy connections (which is every connection this
messenger accepts), so once the no-op-for-non-OSD reset returns, the stale
daemon_connectionsentry becomes the sole surviving owner — exactly matching thebpftrace observation (cleaned but never destroyed).
Fix
Erase
daemon_connectionsunconditionally on reset while keepingosd_conscleanupunder the OSD peer-type guard.
Fixes: https://tracker.ceph.com/issues/78408
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.