diff options
author | Sage Weil <sage@inktank.com> | 2013-07-14 16:16:55 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-07-14 16:16:55 -0700 |
commit | 56c36fa914635f3fe39181003ffa0582e3a0fc9a (patch) | |
tree | ec993a16472564971985695e70ce20dda6016894 | |
parent | bf7c4022d610bf2e330c14d5bccf646bbda63fff (diff) | |
download | ceph-56c36fa914635f3fe39181003ffa0582e3a0fc9a.tar.gz |
mon: include paxos info in report
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/mon/Monitor.cc | 2 | ||||
-rw-r--r-- | src/mon/Paxos.cc | 10 | ||||
-rw-r--r-- | src/mon/Paxos.h | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 86e8cc752c7..1db1b3363f8 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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); diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index d988c641547..358249291c7 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -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 diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index 1cdad50e5bb..741d5e2a098 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -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. |