From: Sage Weil Date: Fri, 11 Apr 2014 20:14:58 +0000 (-0700) Subject: osd/ReplicatedPG: skip missing hit_sets when loading into memory X-Git-Tag: v0.80-rc1~52^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=78df66f52084bd5ba354bb41edce98e032e4811b;p=ceph.git osd/ReplicatedPG: skip missing hit_sets when loading into memory We weren't handling hit_sets that were missing. Two changes here: 1- Load the hit_sets oldest to newest. That means that if we stop partway through loading, and then add another to the end of the list, and then try again to load some more, we will still catch them all. 2- If the object is missing, stop. We'll try again the next time agent_work() is called. Fixes: #8077 Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 90eb87a549f..9095df4ca3f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -10839,9 +10839,8 @@ void ReplicatedPG::agent_load_hit_sets() if (agent_state->hit_set_map.size() < info.hit_set.history.size()) { dout(10) << __func__ << dendl; - for (list::reverse_iterator p = - info.hit_set.history.rbegin(); - p != info.hit_set.history.rend(); ++p) { + for (list::iterator p = info.hit_set.history.begin(); + p != info.hit_set.history.end(); ++p) { if (agent_state->hit_set_map.count(p->begin.sec()) == 0) { dout(10) << __func__ << " loading " << p->begin << "-" << p->end << dendl; @@ -10854,16 +10853,22 @@ void ReplicatedPG::agent_load_hit_sets() // check if it's still in flight if (hit_set_flushing.count(p->begin)) { agent_state->add_hit_set(p->begin.sec(), hit_set_flushing[p->begin]); - } else { - bufferlist bl; - hobject_t oid = get_hit_set_archive_object(p->begin, p->end); - int r = osd->store->read(coll, oid, 0, 0, bl); - assert(r >= 0); - HitSetRef hs(new HitSet); - bufferlist::iterator pbl = bl.begin(); - ::decode(*hs, pbl); - agent_state->add_hit_set(p->begin.sec(), hs); + continue; } + + hobject_t oid = get_hit_set_archive_object(p->begin, p->end); + if (is_unreadable_object(oid)) { + dout(10) << __func__ << " unreadable " << oid << ", waiting" << dendl; + break; + } + + bufferlist bl; + int r = osd->store->read(coll, oid, 0, 0, bl); + assert(r >= 0); + HitSetRef hs(new HitSet); + bufferlist::iterator pbl = bl.begin(); + ::decode(*hs, pbl); + agent_state->add_hit_set(p->begin.sec(), hs); } } }