From: David Zafman Date: Mon, 17 Mar 2014 22:46:05 +0000 (-0700) Subject: osd: Improve logging output including pg_shard_t as osd#(shard) X-Git-Tag: v0.80-rc1~93^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1d99df2742f5d7eb6dac8e0ee34e26eab7de812;p=ceph.git osd: Improve logging output including pg_shard_t as osd#(shard) Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 1b18d83ec59..09bbc14de7b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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::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; } } diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index f57ab0cf242..09fdd6840c8 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -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 --