From 7513e9719a532dc538d838f68e47c83cc51fef82 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 4 Jan 2013 12:43:52 -0800 Subject: [PATCH] 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 (cherry picked from commit e89b6ade63cdad315ab754789de24008cfe42b37) --- src/osd/ReplicatedPG.cc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 955c8474f64d2..20525d3c11f70 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5072,18 +5072,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. -- 2.39.5