From: Sage Weil Date: Wed, 10 Dec 2008 22:25:44 +0000 (-0800) Subject: osd: remove/fix waiting_for_head primary recovery logic X-Git-Tag: v0.6~102 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b300aa644c6107ea0a23f23588b3a1fe143ac9d0;p=ceph.git osd: remove/fix waiting_for_head primary recovery logic Pulling map has the info we need. Simplify. --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 0b5a1bea067..5522d25e2ee 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1988,7 +1988,6 @@ bool ReplicatedPG::pull(pobject_t poid) } else { pull(head); } - waiting_for_head.insert(poid.oid); return false; } @@ -2430,9 +2429,6 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) missing_loc.erase(poid.oid); - if (poid.oid.snap == CEPH_NOSNAP && waiting_for_head.count(poid.oid)) - waiting_for_head.erase(poid.oid); - // close out pull op? if (pulling.count(poid.oid)) pulling.erase(poid.oid); @@ -2687,26 +2683,27 @@ int ReplicatedPG::recover_primary(int max) latest = log.objects[p->first]; assert(latest); + pobject_t poid(info.pgid.pool(), 0, latest->oid); + pobject_t head = poid; + head.oid.snap = CEPH_NOSNAP; + dout(10) << "recover_primary " << *latest << (latest->is_update() ? " (update)":"") << (missing.is_missing(latest->oid) ? " (missing)":"") + << (missing.is_missing(head.oid) ? " (missing head)":"") << (pulling.count(latest->oid) ? " (pulling)":"") - << (waiting_for_head.count(latest->oid) ? " (waiting for head)":"") + << (pulling.count(head.oid) ? " (pulling head)":"") << dendl; assert(latest->is_update()); if (!pulling.count(latest->oid)) { - if (waiting_for_head.count(latest->oid)) { + if (pulling.count(head.oid)) { ++skipped; } else { - pobject_t poid(info.pgid.pool(), 0, latest->oid); - // is this a clone operation that we can do locally? if (latest->op == Log::Entry::CLONE) { - pobject_t head = poid; - head.oid.snap = CEPH_NOSNAP; if (missing.is_missing(head.oid) && missing.have_old(head.oid) == latest->prior_version) { dout(10) << "recover_primary cloning " << head << " v" << latest->prior_version diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index a1ff6bc9490..a838c47bcc2 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -156,7 +156,6 @@ protected: // push/pull map > pulling; // which objects are currently being pulled, and from where map > pushing; - set waiting_for_head; void calc_head_subsets(SnapSet& snapset, pobject_t head, Missing& missing,