]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common,ceph: add output file switch to dump json to
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 1 May 2024 19:09:33 +0000 (15:09 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 3 Mar 2025 20:00:54 +0000 (15:00 -0500)
commitb550bf60adf14b38db2b29adb565e1469afdc2cb
tree7d68a37b859e30ae5e9a186384f5daf0951ffccf
parent2369180fd41d3bd8e15d07dae3d6e0d58595f2a3
common,ceph: add output file switch to dump json to

The `ceph tell mds.X cache dump` and `ceph tell mds.X ops` commands have a
useful `--path` argument that directs the daemon to save the dump of the output
to a file local the daemon. This has several advantages:

* We don't need to construct the JSON output in memory, which may be many gigabytes.
* Streaming writes to a local file is significantly faster than sending the data over the ceph messenger.
* The command spends as little time as possible holding relevant locks.

However, only some commands support this and we could make it generic to the
admin socket interface. So, add a generic --daemon-output-file argument to
achieve this.

The main concern with this is security (telling the daemon to write to
arbitrary files) but this is gated by the session caps which require
"allow_all" and that's typically only valid for the client.admin.

Fixes: https://tracker.ceph.com/issues/65747
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit a3414684974380c1d335f1fcafc5245dbde1c0d6)
src/ceph.in
src/common/Formatter.h
src/common/admin_socket.cc