From: Samuel Just Date: Fri, 4 Jan 2013 20:43:52 +0000 (-0800) Subject: ReplicatedPG: remove old-head optization from push_to_replica X-Git-Tag: v0.57~242^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e89b6ade63cdad315ab754789de24008cfe42b37;p=ceph.git ReplicatedPG: remove old-head optization from push_to_replica This optimization allowed the primary to push a clone as a single push in the case that the head object on the replica is old and happens to be at the same version as the clone. In general, using head in clone_subsets is tricky since we might be writing to head during the push. calc_clone_subsets does not consider head (probably for this reason). Handling the clone from head case properly would require blocking writes on head in the interim which is probably a bad trade off anyway. Because the old-head optimization only comes into play if the replica's state happens to fall on the last write to head prior to the snap that caused the clone in question, it's not worth the complexity. Fixes: #3698 Signed-off-by: Samuel Just Reviewed-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 59e055d58294..cbae003827c6 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5073,18 +5073,6 @@ void ReplicatedPG::push_to_replica( if (soid.snap && soid.snap < CEPH_NOSNAP) { hobject_t head = soid; head.snap = CEPH_NOSNAP; - if (peer_missing[peer].is_missing(head) && - peer_missing[peer].have_old(head) == oi.prior_version) { - dout(10) << "push_to_replica osd." << peer << " has correct old " << head - << " v" << oi.prior_version - << ", pushing " << soid << " attrs as a clone op" << dendl; - interval_set data_subset; - map > clone_subsets; - if (size) - clone_subsets[head].insert(0, size); - push_start(prio, obc, soid, peer, oi.version, data_subset, clone_subsets); - return; - } // try to base push off of clones that succeed/preceed poid // we need the head (and current SnapSet) locally to do that.