summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-15 14:23:40 -0700
committerSage Weil <sage@inktank.com>2013-07-15 14:23:40 -0700
commit40a8bbdc53b0500d5472e42e55c1865aeb5661e5 (patch)
tree9ad7f2b30c1b40ab1ca14ae528e1af1e5944b3e4
parentdaf767230913c56eef32856f09e75f884a32f6d0 (diff)
parent6b7d9f2b3ee7bbe901e6a04d53ee8626f2a3d2c9 (diff)
downloadceph-40a8bbdc53b0500d5472e42e55c1865aeb5661e5.tar.gz
Merge remote-tracking branch 'gh/wip-mon-report' into next
-rw-r--r--src/auth/cephx/CephxKeyServer.h3
-rw-r--r--src/mon/AuthMonitor.cc10
-rw-r--r--src/mon/AuthMonitor.h2
-rw-r--r--src/mon/MDSMonitor.cc2
-rw-r--r--src/mon/Monitor.cc3
-rw-r--r--src/mon/MonmapMonitor.cc3
-rw-r--r--src/mon/OSDMonitor.cc2
-rw-r--r--src/mon/PGMonitor.cc2
-rw-r--r--src/mon/Paxos.cc10
-rw-r--r--src/mon/Paxos.h6
10 files changed, 42 insertions, 1 deletions
diff --git a/src/auth/cephx/CephxKeyServer.h b/src/auth/cephx/CephxKeyServer.h
index 905eb71fe17..bc30fef640b 100644
--- a/src/auth/cephx/CephxKeyServer.h
+++ b/src/auth/cephx/CephxKeyServer.h
@@ -268,6 +268,9 @@ public:
map<EntityName, EntityAuth>::const_iterator b = data.secrets_begin();
return (b != data.secrets_end());
}
+ int get_num_secrets() {
+ return data.secrets.size();
+ }
/*void add_rotating_secret(uint32_t service_id, ExpiringCryptoKey& key) {
Mutex::Locker l(lock);
diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc
index 9f8c2ea260d..83b7ac2ce0c 100644
--- a/src/mon/AuthMonitor.cc
+++ b/src/mon/AuthMonitor.cc
@@ -997,3 +997,13 @@ void AuthMonitor::upgrade_format()
propose_pending();
}
}
+
+void AuthMonitor::dump_info(Formatter *f)
+{
+ /*** WARNING: do not include any privileged information here! ***/
+ f->open_object_section("auth");
+ f->dump_unsigned("first_committed", get_first_committed());
+ f->dump_unsigned("last_committed", get_last_committed());
+ f->dump_unsigned("num_secrets", mon->key_server.get_num_secrets());
+ f->close_section();
+}
diff --git a/src/mon/AuthMonitor.h b/src/mon/AuthMonitor.h
index f538e737856..30d567a77ca 100644
--- a/src/mon/AuthMonitor.h
+++ b/src/mon/AuthMonitor.h
@@ -157,6 +157,8 @@ private:
void pre_auth(MAuth *m);
void tick(); // check state, take actions
+
+ void dump_info(Formatter *f);
};
diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc
index 169834ab0e3..1865a845af3 100644
--- a/src/mon/MDSMonitor.cc
+++ b/src/mon/MDSMonitor.cc
@@ -529,6 +529,8 @@ void MDSMonitor::dump_info(Formatter *f)
f->open_object_section("mdsmap");
mdsmap.dump(f);
f->close_section();
+
+ f->dump_unsigned("mdsmap_first_committed", get_first_committed());
}
bool MDSMonitor::preprocess_command(MMonCommand *m)
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index 9b665bdad3d..82b57c2e7bb 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -2130,6 +2130,9 @@ void Monitor::handle_command(MMonCommand *m)
osdmon()->dump_info(f.get());
mdsmon()->dump_info(f.get());
pgmon()->dump_info(f.get());
+ authmon()->dump_info(f.get());
+
+ paxos->dump_info(f.get());
f->close_section();
f->flush(ds);
diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc
index d04418b6391..195f66350d8 100644
--- a/src/mon/MonmapMonitor.cc
+++ b/src/mon/MonmapMonitor.cc
@@ -137,13 +137,14 @@ bool MonmapMonitor::preprocess_query(PaxosServiceMessage *m)
void MonmapMonitor::dump_info(Formatter *f)
{
+ f->dump_unsigned("monmap_first_committed", get_first_committed());
f->open_object_section("monmap");
mon->monmap->dump(f);
+ f->close_section();
f->open_array_section("quorum");
for (set<int>::iterator q = mon->get_quorum().begin(); q != mon->get_quorum().end(); ++q)
f->dump_int("mon", *q);
f->close_section();
- f->close_section();
}
bool MonmapMonitor::preprocess_command(MMonCommand *m)
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 7e76ea271c4..a2d3f491842 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -1912,6 +1912,8 @@ void OSDMonitor::dump_info(Formatter *f)
osdmap.dump(f);
f->close_section();
+ f->dump_unsigned("osdmap_first_committed", get_first_committed());
+
f->open_object_section("crushmap");
osdmap.crush->dump(f);
f->close_section();
diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc
index 365d836cebd..f96fb22c03f 100644
--- a/src/mon/PGMonitor.cc
+++ b/src/mon/PGMonitor.cc
@@ -1295,6 +1295,8 @@ void PGMonitor::dump_info(Formatter *f)
f->open_object_section("pgmap");
pg_map.dump(f);
f->close_section();
+
+ f->dump_unsigned("pgmap_first_committed", get_first_committed());
}
bool PGMonitor::preprocess_command(MMonCommand *m)
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 26886451a49..ee2ba3b6fdb 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 c85bcaf495e..cab27f289a8 100644
--- a/src/mon/Paxos.h
+++ b/src/mon/Paxos.h
@@ -1030,6 +1030,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.