]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Improve logging output including pg_shard_t as osd#(shard)
authorDavid Zafman <david.zafman@inktank.com>
Mon, 17 Mar 2014 22:46:05 +0000 (15:46 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Tue, 25 Mar 2014 18:11:13 +0000 (11:11 -0700)
Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/PG.cc
src/osd/osd_types.cc

index 1b18d83ec593240f843ccc0a13fa64dfeb8b79bc..09bbc14de7b15381fc03e8439b3de647931fb39e 100644 (file)
@@ -536,7 +536,9 @@ bool PG::needs_recovery() const
   const pg_missing_t &missing = pg_log.get_missing();
 
   if (missing.num_missing()) {
-    dout(10) << __func__ << " primary has " << missing.num_missing() << dendl;
+    dout(10) << __func__ << " primary has " << missing.num_missing()
+      << " missing" << dendl;
+
     ret = true;
   }
 
@@ -549,12 +551,14 @@ bool PG::needs_recovery() const
     pg_shard_t peer = *a;
     map<pg_shard_t, pg_missing_t>::const_iterator pm = peer_missing.find(peer);
     if (pm == peer_missing.end()) {
-      dout(10) << __func__ << " osd." << peer << " don't have missing set" << dendl;
+      dout(10) << __func__ << " osd." << peer << " doesn't have missing set"
+        << dendl;
       ret = true;
       continue;
     }
     if (pm->second.num_missing()) {
-      dout(10) << __func__ << " osd." << peer << " has " << pm->second.num_missing() << " missing" << dendl;
+      dout(10) << __func__ << " osd." << peer << " has "
+        << pm->second.num_missing() << " missing" << dendl;
       ret = true;
     }
   }
index f57ab0cf242bdc21234b080f4e0487661bf6ce6d..09fdd6840c8df35c66d2a4bb26ec6d6fd3e87253 100644 (file)
@@ -82,7 +82,11 @@ void pg_shard_t::decode(bufferlist::iterator &bl)
 
 ostream &operator<<(ostream &lhs, const pg_shard_t &rhs)
 {
-  return lhs << '(' << rhs.osd << ',' << (unsigned)(rhs.shard) << ')';
+  if (rhs.is_undefined())
+    return lhs << "?";
+  if (rhs.shard == ghobject_t::NO_SHARD)
+    return lhs << rhs.osd;
+  return lhs << rhs.osd << '(' << (unsigned)(rhs.shard) << ')';
 }
 
 // -- osd_reqid_t --