summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mon/Paxos.h2
-rw-r--r--src/tools/ceph-monstore-tool.cc14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h
index cab27f289a8..3df238e1933 100644
--- a/src/mon/Paxos.h
+++ b/src/mon/Paxos.h
@@ -1114,7 +1114,7 @@ public:
* @param t The transaction to which we will append the operations
* @param bl A bufferlist containing an encoded transaction
*/
- void decode_append_transaction(MonitorDBStore::Transaction& t,
+ static void decode_append_transaction(MonitorDBStore::Transaction& t,
bufferlist& bl) {
MonitorDBStore::Transaction vt;
bufferlist::iterator it = bl.begin();
diff --git a/src/tools/ceph-monstore-tool.cc b/src/tools/ceph-monstore-tool.cc
index ae608a302f2..f361266aff0 100644
--- a/src/tools/ceph-monstore-tool.cc
+++ b/src/tools/ceph-monstore-tool.cc
@@ -31,6 +31,7 @@
#include "global/global_init.h"
#include "os/LevelDBStore.h"
#include "mon/MonitorDBStore.h"
+#include "mon/Paxos.h"
#include "common/Formatter.h"
namespace po = boost::program_options;
@@ -246,6 +247,19 @@ int main(int argc, char **argv) {
goto done;
}
bl.write_fd(fd);
+ } else if (cmd == "dump-paxos") {
+ for (version_t v = dstart; v <= dstop; ++v) {
+ bufferlist bl;
+ st.get("paxos", v, bl);
+ if (bl.length() == 0)
+ break;
+ cout << "\n--- " << v << " ---" << std::endl;
+ MonitorDBStore::Transaction tx;
+ Paxos::decode_append_transaction(tx, bl);
+ JSONFormatter f(true);
+ tx.dump(&f);
+ f.flush(cout);
+ }
} else if (cmd == "dump-trace") {
if (tfile.empty()) {
std::cerr << "Need trace_file" << std::endl;