]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: dump last epoch clean info on report
authorJoao Eduardo Luis <joao@suse.de>
Tue, 21 Nov 2017 10:15:10 +0000 (10:15 +0000)
committerNathan Cutler <ncutler@suse.com>
Wed, 6 May 2020 12:29:21 +0000 (14:29 +0200)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
(cherry picked from commit bd2e5c62757c17d00f30620c043ed06abb8a0bca)

src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h

index b4cc322b9f0b5a350b544b3e33d161ac379a19fe..c176e0769efbabfa9eab5f622135c214da13f19c 100644 (file)
@@ -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());
 
index 2b3a47bfc1b1866baaacea822fe4c32fb7e07631..f8599a264ae8aec00cb4e1e2bfce5ad49a2af058 100644 (file)
@@ -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;
 };