From: Colin Patrick McCabe Date: Thu, 25 Nov 2010 07:13:43 +0000 (-0800) Subject: osd: discover_all_missing fix X-Git-Tag: v0.24~111 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da087e47c21190f9cbde4d24182b7dfe581cd069;p=ceph.git osd: discover_all_missing fix Don't request information from an OSD unless it is up and part of the might_have_unfound set. Add more logging. Signed-off-by: Colin McCabe --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 4f4c96a692fe..96374807aa20 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -584,21 +584,45 @@ void PG::discover_all_missing(map< int, map > &query_map) << get_num_unfound() << " unfound" << dendl; - std::map::const_iterator end = peer_info.end(); - for (std::map::const_iterator pi = peer_info.begin(); - pi != end; ++pi) - { - int from(pi->first); - if (peer_missing.find(from) != peer_missing.end()) + std::vector::const_iterator u = up.begin(); + std::vector::const_iterator end = up.end(); + std::set::const_iterator mhend = might_have_unfound.end(); + for (; u != end; ++u) { + int peer(*u); + if (might_have_unfound.find(peer) == mhend) { + dout(25) << __func__ << ": osd" << peer + << " is not in might_have_unfound" << dendl; + continue; + } + // If we've requested any of this stuff, the Missing information + // should be on its way. + // TODO: coalsce requested_* into a single data structure + if (peer_missing.find(peer) != peer_missing.end()) { + dout(25) << __func__ << ": osd" << peer + << ": we already have Missing" << dendl; continue; - if (peer_log_requested.find(from) != peer_log_requested.end()) + } + if (peer_log_requested.find(peer) != peer_log_requested.end()) { + dout(25) << __func__ << ": osd" << peer + << ": in peer_log_requested" << dendl; continue; - if (peer_backlog_requested.find(from) != peer_backlog_requested.end()) + } + if (peer_backlog_requested.find(peer) != peer_backlog_requested.end()) { + dout(25) << __func__ << ": osd" << peer + << ": in peer_backlog_requested" << dendl; continue; - if (peer_missing_requested.find(from) != peer_missing_requested.end()) + } + if (peer_missing_requested.find(peer) != peer_missing_requested.end()) { + dout(25) << __func__ << ": osd" << peer + << ": in peer_missing_requested" << dendl; continue; - peer_missing_requested.insert(from); - query_map[from][info.pgid] = + } + + // Request missing + dout(10) << __func__ << ": osd" << peer << ": requesting Missing" + << dendl; + peer_missing_requested.insert(peer); + query_map[peer][info.pgid] = PG::Query(PG::Query::MISSING, info.history); } }