From 55fff48c5db17e96276d1181f7e942bb76a206db Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Tue, 21 Nov 2017 10:15:10 +0000 Subject: [PATCH] mon/OSDMonitor: dump last epoch clean info on report Signed-off-by: Joao Eduardo Luis (cherry picked from commit bd2e5c62757c17d00f30620c043ed06abb8a0bca) --- src/mon/OSDMonitor.cc | 31 +++++++++++++++++++++++++++++++ src/mon/OSDMonitor.h | 2 ++ 2 files changed, 33 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 004ba7d786e77..f4f887b4280d0 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -343,6 +343,19 @@ epoch_t LastEpochClean::get_lower_bound(const OSDMap& latest) const return floor; } +void LastEpochClean::dump(Formatter *f) const +{ + f->open_array_section("per_pool"); + + for (auto it : report_by_pool) { + f->open_object_section("pool"); + f->dump_unsigned("poolid", it.first); + f->dump_unsigned("floor", it.second.floor); + f->close_section(); + } + + f->close_section(); +} class C_UpdateCreatingPGs : public Context { public: @@ -4923,6 +4936,24 @@ void OSDMonitor::dump_info(Formatter *f) } f->close_section(); + f->open_object_section("osdmap_clean_epochs"); + f->dump_unsigned("min_last_epoch_clean", get_min_last_epoch_clean()); + + f->open_object_section("last_epoch_clean"); + last_epoch_clean.dump(f); + f->close_section(); + + f->open_array_section("osd_epochs"); + for (auto& osd_epoch : osd_epochs) { + f->open_object_section("osd"); + f->dump_unsigned("id", osd_epoch.first); + f->dump_unsigned("epoch", osd_epoch.second); + f->close_section(); + } + f->close_section(); // osd_epochs + + f->close_section(); // osd_clean_epochs + f->dump_unsigned("osdmap_first_committed", get_first_committed()); f->dump_unsigned("osdmap_last_committed", get_last_committed()); diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index f4ed142865f69..3ff948ad3c869 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -127,6 +127,8 @@ public: void report(const pg_t& pg, epoch_t last_epoch_clean); void remove_pool(uint64_t pool); epoch_t get_lower_bound(const OSDMap& latest) const; + + void dump(Formatter *f) const; }; -- 2.39.5