From: Kefu Chai Date: Sun, 16 Feb 2020 06:10:25 +0000 (+0800) Subject: crimson/osd: add OSD::dump_status() X-Git-Tag: v15.1.1~398^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9680af08201e0a1dc59b2c20eaa02eb5fd3a7ca9;p=ceph-ci.git crimson/osd: add OSD::dump_status() so it can be used by asock command Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 18b6fa62a86..21faffd3bff 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -440,6 +440,17 @@ seastar::future<> OSD::stop() }); } +void OSD::dump_status(Formatter* f) const +{ + f->dump_stream("cluster_fsid") << superblock.cluster_fsid; + f->dump_stream("osd_fsid") << superblock.osd_fsid; + f->dump_unsigned("whoami", superblock.whoami); + f->dump_string("state", state.to_string()); + f->dump_unsigned("oldest_map", superblock.oldest_map); + f->dump_unsigned("newest_map", superblock.newest_map); + f->dump_unsigned("num_pgs", pg_map.get_pgs().size()); +} + seastar::future<> OSD::load_pgs() { return store->list_collections().then([this](auto colls) { diff --git a/src/crimson/osd/osd.h b/src/crimson/osd/osd.h index 0630793f44f..45dffb44fdc 100644 --- a/src/crimson/osd/osd.h +++ b/src/crimson/osd/osd.h @@ -131,6 +131,8 @@ public: seastar::future<> start(); seastar::future<> stop(); + void dump_status(Formatter*) const; + private: seastar::future<> start_boot(); seastar::future<> _preboot(version_t oldest_osdmap, version_t newest_osdmap);