From: Joao Eduardo Luis Date: Tue, 21 Nov 2017 10:15:10 +0000 (+0000) Subject: mon/OSDMonitor: dump last epoch clean info on report X-Git-Tag: v15.2.2~4^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1fd3adcf22feddbe50cd307eea9194e11493e183;p=ceph.git mon/OSDMonitor: dump last epoch clean info on report Signed-off-by: Joao Eduardo Luis (cherry picked from commit bd2e5c62757c17d00f30620c043ed06abb8a0bca) --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index b4cc322b9f0b..c176e0769efb 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -378,6 +378,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: @@ -5180,6 +5193,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 2b3a47bfc1b1..f8599a264ae8 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; };