From: Kefu Chai Date: Sun, 6 Sep 2020 06:49:30 +0000 (+0800) Subject: crimson/osd: add PG::dump_primary() X-Git-Tag: v17.0.0~1210^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=acfa6ea4a5dace0c31d36ebdce36feeaec5588dd;p=ceph.git crimson/osd: add PG::dump_primary() for implementing asock command "ceph tell 1.0 query" Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index c4b3f5df18af7..22ad38b74a2a9 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -495,6 +495,19 @@ void PG::print(ostream& out) const out << peering_state << " "; } +void PG::dump_primary(Formatter* f) +{ + peering_state.dump_peering_state(f); + + f->open_array_section("recovery_state"); + PeeringState::QueryState q(f); + peering_state.handle_event(q, 0); + f->close_section(); + + // TODO: snap_trimq + // TODO: scrubber state + // TODO: agent state +} std::ostream& operator<<(std::ostream& os, const PG& pg) { diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 1f8e0a0bf614c..104483d8e819b 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -529,6 +529,7 @@ public: const MOSDRepOpReply& m); void print(std::ostream& os) const; + void dump_primary(Formatter*); private: void do_peering_event(