]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG/Backend: fix up recalc_subsets
authorSamuel Just <sam.just@inktank.com>
Mon, 9 Sep 2013 22:48:50 +0000 (15:48 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 26 Sep 2013 18:24:28 +0000 (11:24 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedBackend.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index ae33b3f5588e0048660fd071d763e899ff18e1d2..af8b3e291b60c9486d2e8765457af4059996de9a 100644 (file)
@@ -300,6 +300,10 @@ private:
                         const hobject_t &last_backfill,
                         interval_set<uint64_t>& data_subset,
                         map<hobject_t, interval_set<uint64_t> >& clone_subsets);
+  ObjectRecoveryInfo recalc_subsets(
+    const ObjectRecoveryInfo& recovery_info,
+    SnapSetContext *ssc
+    );
 };
 
 #endif
index f5c816c52c4d5a8ca80816a5964caa65f13df185..1f688f97aa2e76b412ee1c02c8070e9ba4fb6ea9 100644 (file)
@@ -6292,27 +6292,19 @@ void ReplicatedBackend::submit_push_complete(ObjectRecoveryInfo &recovery_info,
   }
 }
 
-ObjectRecoveryInfo ReplicatedPG::recalc_subsets(const ObjectRecoveryInfo& recovery_info)
+ObjectRecoveryInfo ReplicatedBackend::recalc_subsets(
+  const ObjectRecoveryInfo& recovery_info,
+  SnapSetContext *ssc)
 {
   if (!recovery_info.soid.snap || recovery_info.soid.snap >= CEPH_NOSNAP)
     return recovery_info;
-
-  SnapSetContext *ssc = get_snapset_context(recovery_info.soid.oid,
-                                           recovery_info.soid.get_key(),
-                                           recovery_info.soid.hash,
-                                           false,
-                                           recovery_info.soid.get_namespace());
-  assert(ssc);
   ObjectRecoveryInfo new_info = recovery_info;
   new_info.copy_subset.clear();
   new_info.clone_subset.clear();
   assert(ssc);
-// TODOSAM: fix
-#if 0
-  calc_clone_subsets(ssc->snapset, new_info.soid, pg_log.get_missing(), info.last_backfill,
+  calc_clone_subsets(ssc->snapset, new_info.soid, get_parent()->get_local_missing(),
+                    get_info().last_backfill,
                     new_info.copy_subset, new_info.clone_subset);
-#endif
-  put_snapset_context(ssc);
   return new_info;
 }
 
@@ -6352,8 +6344,13 @@ bool ReplicatedBackend::handle_pull_response(
       pop.recovery_info.copy_subset);
   }
 
-  // TODOSAM: probably just kill this
-  //pi.recovery_info = recalc_subsets(pi.recovery_info);
+  bool first = pi.recovery_progress.first;
+  if (first) {
+    pi.obc = get_parent()->get_obc(pi.recovery_info.soid, pop.attrset);
+    pi.recovery_info.oi = pi.obc->obs.oi;
+    pi.recovery_info = recalc_subsets(pi.recovery_info, pi.obc->ssc);
+  }
+
 
   interval_set<uint64_t> usable_intervals;
   bufferlist usable_data;
@@ -6366,7 +6363,6 @@ bool ReplicatedBackend::handle_pull_response(
   data.claim(usable_data);
 
 
-  bool first = pi.recovery_progress.first;
   pi.recovery_progress = pop.after_progress;
 
   pi.stat.num_bytes_recovered += data.length();
@@ -6375,11 +6371,6 @@ bool ReplicatedBackend::handle_pull_response(
           << ", new progress " << pi.recovery_progress
           << dendl;
 
-  if (first) {
-    pi.obc = get_parent()->get_obc(pi.recovery_info.soid, pop.attrset);
-    pi.recovery_info.oi = pi.obc->obs.oi;
-  }
-
   bool complete = pi.is_complete();
 
   submit_push_data(pi.recovery_info, first,
index 2908e4291b4a01a637e181715180905c5fe4e02b..cdd57e1581a08e95041c20d89452ac7908ad224d 100644 (file)
@@ -503,20 +503,6 @@ protected:
 
   set<hobject_t> recovering;
 
-  ObjectRecoveryInfo recalc_subsets(const ObjectRecoveryInfo& recovery_info);
-    
-  void submit_push_data(ObjectRecoveryInfo &recovery_info,
-                       bool first,
-                       bool complete,
-                       const interval_set<uint64_t> &intervals_included,
-                       bufferlist data_included,
-                       bufferlist omap_header,
-                       map<string, bufferptr> &attrs,
-                       map<string, bufferlist> &omap_entries,
-                       ObjectStore::Transaction *t);
-  void submit_push_complete(ObjectRecoveryInfo &recovery_info,
-                           ObjectStore::Transaction *t);
-
   // Track contents of temp collection, clear on reset
   set<hobject_t> temp_contents;