From 0abf2c9b9bf4156e54b5bb966815b02d26264068 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 10 Mar 2011 10:17:24 -0800 Subject: [PATCH] osd: fix peer no missing optimization This shortcut was broken: we need to populate peer_missing with missing objects in terms of the master log, not the peer's log (which may be old or even divergent). This shortcut _only_ makes sense when the peer has no missing in terms of a log that is perfectly up to date (i.e. matches our last_update). Reported-by: Henry Chang Signed-off-by: Sage Weil --- src/osd/PG.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index d3f09a201845b..cbfcbbcbead2b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1634,8 +1634,11 @@ void PG::do_peer(ObjectStore::Transaction& t, list& tfin, if (pi.is_empty()) continue; if (peer_missing.find(peer) == peer_missing.end()) { - if (pi.last_update == pi.last_complete) { - dout(10) << " infering no missing (last_update==last_complete) for osd" << peer << dendl; + if (pi.last_update == pi.last_complete && // peer has no missing + pi.last_update == info.last_update) { // peer is up to date + // replica has no missing and identical log as us. no need to + // pull anything. + dout(10) << " infering up to date and no missing (last_update==last_complete) for osd" << peer << dendl; peer_missing[peer].num_missing(); // just create the entry. search_for_missing(peer_info[peer], &peer_missing[peer], peer); continue; -- 2.39.5