From: Sage Weil Date: Fri, 16 Mar 2012 21:36:38 +0000 (-0700) Subject: osd: remove special handline for head recovery from clone X-Git-Tag: v0.44~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=63ec06b349c6f66d6bf95af8a7bb6c08165f567f;p=ceph.git osd: remove special handline for head recovery from clone This breaks because: - we don't have the head or current snapset - get_object_context() creates a new snapset, which is wrong We probably can only do this if we are certain we can construct/modify the old snapset and end up with the correct one. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1a520180786d..f87cf99dfa5f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5766,48 +5766,11 @@ int ReplicatedPG::recover_primary(int max) if (latest) { switch (latest->op) { case pg_log_entry_t::CLONE: - { - // is this a clone operation that we can do locally? - if (missing.is_missing(head) && - missing.have_old(head) == latest->prior_version) { - dout(10) << "recover_primary cloning " << head << " v" << latest->prior_version - << " to " << soid << " v" << latest->version - << " snaps " << latest->snaps << dendl; - ObjectStore::Transaction *t = new ObjectStore::Transaction; - - // NOTE: we know headobc exists on disk, and the oloc will be loaded with it, so - // it is safe to pass in a blank one here. - ObjectContext *headobc = get_object_context(head, OLOC_BLANK, false); - - object_info_t oi(headobc->obs.oi); - oi.soid = soid; - oi.version = latest->version; - oi.prior_version = latest->prior_version; - bufferlist::iterator i = latest->snaps.begin(); - ::decode(oi.snaps, i); - assert(oi.snaps.size() > 0); - oi.copy_user_bits(headobc->obs.oi); - - ObjectContext *clone_obc = new ObjectContext(oi, true, NULL); - clone_obc->get(); - clone_obc->ondisk_write_lock(); - clone_obc->ssc = get_snapset_context(soid.oid, soid.get_key(), soid.hash, true); - register_object_context(clone_obc); - - _make_clone(*t, head, soid, &clone_obc->obs.oi); - - Context *onreadable = new C_OSD_AppliedRecoveredObject(this, t, clone_obc); - Context *onreadable_sync = new C_OSD_OndiskWriteUnlock(clone_obc); - int tr = osd->store->queue_transaction(&osr, t, onreadable, NULL, onreadable_sync); - assert(tr == 0); - - put_object_context(headobc); - - missing.got(latest->soid, latest->version); - missing_loc.erase(latest->soid); - continue; - } - } + /* + * Handling for this special case removed for now, until we + * can correctly construct an accurate SnapSet from the old + * one. + */ break; case pg_log_entry_t::LOST_REVERT: