]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: include paxos info in report
authorSage Weil <sage@inktank.com>
Sun, 14 Jul 2013 23:16:55 +0000 (16:16 -0700)
committerSage Weil <sage@inktank.com>
Sun, 14 Jul 2013 23:16:55 +0000 (16:16 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc
src/mon/Paxos.cc
src/mon/Paxos.h

index 86e8cc752c78ab4f4c2d03baf6dc379ecee9d61e..1db1b3363f86fcb8498ff616eb41ece9e9d84b86 100644 (file)
@@ -2119,6 +2119,8 @@ void Monitor::handle_command(MMonCommand *m)
     mdsmon()->dump_info(f.get());
     pgmon()->dump_info(f.get());
 
+    paxos->dump_info(f.get());
+
     f->close_section();
     f->flush(ds);
 
index d988c6415476a97b7ebd6c720d14caf4d41f9afc..358249291c7926ad2c9baefaa869f9adb3340928 100644 (file)
@@ -73,6 +73,16 @@ void Paxos::init()
   assert(is_consistent());
 }
 
+void Paxos::dump_info(Formatter *f)
+{
+  f->open_object_section("paxos");
+  f->dump_unsigned("first_committed", first_committed);
+  f->dump_unsigned("last_committed", last_committed);
+  f->dump_unsigned("last_pn", last_pn);
+  f->dump_unsigned("accepted_pn", accepted_pn);
+  f->close_section();
+}
+
 // ---------------------------------
 
 // PHASE 1
index 1cdad50e5bbedc76cbd9a268c26ae06e07b7f0c8..741d5e2a0988470505700170af003e1047be3edc 100644 (file)
@@ -1018,6 +1018,12 @@ public:
   void read_and_prepare_transactions(MonitorDBStore::Transaction *tx, version_t from, version_t last);
 
   void init();
+
+  /**
+   * dump state info to a formatter
+   */
+  void dump_info(Formatter *f);
+
   /**
    * This function runs basic consistency checks. Importantly, if
    * it is inconsistent and shouldn't be, it asserts out.