]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: improve last_peering_reset debugging
authorSage Weil <sage.weil@dreamhost.com>
Mon, 31 Oct 2011 18:57:14 +0000 (11:57 -0700)
committerSage Weil <sage@newdream.net>
Wed, 9 Nov 2011 22:32:53 +0000 (14:32 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/messages/MOSDPGQuery.h
src/osd/PG.cc
src/osd/PG.h

index 123cff37523d2411a1b61909bac9c602b4940605..a601c7ed7487269c0898cebe061cec70fa0cb514 100644 (file)
@@ -39,7 +39,16 @@ private:
   ~MOSDPGQuery() {}
 
 public:  
-  const char *get_type_name() { return "PGq"; }
+  const char *get_type_name() { return "pg_query"; }
+  void print(ostream& out) {
+    out << "pg_query(";
+    for (map<pg_t,PG::Query>::iterator p = pg_list.begin(); p != pg_list.end(); ++p) {
+      if (p != pg_list.begin())
+       out << ",";
+      out << p->first;
+    }
+    out << " epoch " << epoch << ")";
+  }
 
   void encode_payload(CephContext *cct) {
     ::encode(epoch, payload);
index eea3e168062c16b7de2ec5a1e4ca8e31dba4bc88..f20f623800945bdf8cd95bd6cb30f74290a8b5bf 100644 (file)
@@ -3442,17 +3442,23 @@ bool PG::may_need_replay(const OSDMap *osdmap) const
 bool PG::acting_up_affected(const vector<int>& newup, const vector<int>& newacting)
 {
   if (acting != newacting || up != newup) {
+    dout(20) << "acting_up_affected newup " << newup << " newacting " << newacting << dendl;
     return true;
   } else {
     return false;
   }
 }
 
-bool PG::old_peering_msg(epoch_t reply_epoch,
-                        epoch_t query_epoch)
+bool PG::old_peering_msg(epoch_t reply_epoch, epoch_t query_epoch)
 {
-  return (last_peering_reset > reply_epoch ||
-         last_peering_reset > query_epoch);
+  if (last_peering_reset > reply_epoch ||
+      last_peering_reset > query_epoch) {
+    dout(10) << "old_peering_msg reply_epoch " << reply_epoch << " query_epoch " << query_epoch
+            << " last_peering_reset " << last_peering_reset
+            << dendl;
+    return true;
+  }
+  return false;
 }
 
 
@@ -3469,7 +3475,9 @@ void PG::on_removal()
   remove_watchers_and_notifies();
 }
 
-void PG::set_last_peering_reset() {
+void PG::set_last_peering_reset()
+{
+  dout(20) << "set_last_peering_reset " << osd->osdmap->get_epoch() << dendl;
   last_peering_reset = osd->osdmap->get_epoch();
 }
 
@@ -3777,6 +3785,7 @@ ostream& operator<<(ostream& out, const PG& pg)
   if (pg.acting != pg.up)
     out << "/" << pg.acting;
   out << " r=" << pg.get_role();
+  out << " lpr=" << pg.get_last_peering_reset();
 
   if (pg.is_active() &&
       pg.last_update_ondisk != pg.info.last_update)
index a2ef11d72f3fb226a21da28c3132a25691be99e5..32b04d3d324b37d3e0646e34f31cb2f927d6daa3 100644 (file)
@@ -1583,6 +1583,8 @@ public:
 
   bool       is_primary() const { return role == PG_ROLE_HEAD; }
   bool       is_replica() const { return role > 0; }
+
+  epoch_t get_last_peering_reset() const { return last_peering_reset; }
   
   //int  get_state() const { return state; }
   bool state_test(int m) const { return (state & m) != 0; }