]> git-server-git.apps.pok.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:44:18 +0000 (13:44 -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>
src/osd/ReplicatedPG.cc

index 59e055d582947820d251cb31e915b6fcccbc564f..cbae003827c6802a21eaf01cfae89e178f22f22d 100644 (file)
@@ -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<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.