]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: only increment active_scrub on primary for final push
authorSamuel Just <sam.just@inktank.com>
Fri, 30 Nov 2012 22:04:53 +0000 (14:04 -0800)
committerSamuel Just <sam.just@inktank.com>
Fri, 30 Nov 2012 22:04:53 +0000 (14:04 -0800)
We only queue the _applied_recovered_object callback on the primary for the
final push.  It is this callback which decrements active_pushes.  It's ok to
not increment active_pushes for the intermediate pushes since these only affact
a temp file.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index 388751e8e8bf4c896e908d8890dda5544501ecf0..e66c77e2f787c206f9d6f5bfeaeae39e430f49f4 100644 (file)
@@ -5326,6 +5326,9 @@ void ReplicatedPG::handle_pull_response(OpRequestRef op)
 
     obc->ondisk_write_lock();
 
+    // keep track of active pushes for scrub
+    ++active_pushes;
+
     onreadable = new C_OSD_AppliedRecoveredObject(this, t, obc);
     onreadable_sync = new C_OSD_OndiskWriteUnlock(obc);
   } else {
@@ -5376,6 +5379,10 @@ void ReplicatedPG::handle_push(OpRequestRef op)
   bool complete = m->recovery_progress.data_complete &&
     m->recovery_progress.omap_complete;
   ObjectStore::Transaction *t = new ObjectStore::Transaction;
+
+  // keep track of active pushes for scrub
+  ++active_pushes;
+
   Context *onreadable = new C_OSD_AppliedRecoveredObjectReplica(this, t);
   Context *onreadable_sync = 0;
   submit_push_data(m->recovery_info,
@@ -5811,9 +5818,6 @@ void ReplicatedPG::sub_op_push(OpRequestRef op)
 {
   op->mark_started();
 
-  // keep track of active pushes for scrub
-  ++active_pushes;
-
   if (is_primary()) {
     handle_pull_response(op);
   } else {