summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-21 07:57:23 -0700
committerSage Weil <sage@inktank.com>2013-07-22 14:12:51 -0700
commita61635e85218dd2e19d339385066e5a6a9c86346 (patch)
treecb0bab8d3f424df6627f3cc756c84fd185a0eae2
parent58c78dbaf357def4c7bf6fb95a0248a1ccf6c3c6 (diff)
downloadceph-a61635e85218dd2e19d339385066e5a6a9c86346.tar.gz
ceph-monstore-tool: dump paxos transactions
Signed-off-by: Sage Weil <sage@inktank.com>
-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;