]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: remove old-head optization from push_to_replica
authorSamuel Just <sam.just@inktank.com>
Fri, 4 Jan 2013 20:43:52 +0000 (12:43 -0800)
committerSamuel Just <sam.just@inktank.com>
Fri, 4 Jan 2013 21:45:32 +0000 (13:45 -0800)
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 <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit e89b6ade63cdad315ab754789de24008cfe42b37)

src/osd/ReplicatedPG.cc

index 955c8474f64d22fed0e8c7e21b1f6728fff12a3e..20525d3c11f70a102ebdc1081a352177e0ba6485 100644 (file)
@@ -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<uint64_t> data_subset;
-      map<hobject_t, interval_set<uint64_t> > 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.