]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: simplify how in-progress ops are requeued
authorSage Weil <sage@inktank.com>
Thu, 16 Aug 2012 00:19:11 +0000 (17:19 -0700)
committerSage Weil <sage@inktank.com>
Thu, 16 Aug 2012 20:15:10 +0000 (13:15 -0700)
Requeue them explicity from apply_and_flush_repops() and call it last, so
that the overall ordering is preserved.

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

index 1d4abf99ff5dd00e10983ca8e21892660dfda286..3e1b0dfbd0ed4cf6633815d6e8b72d54147f947d 100644 (file)
@@ -5737,7 +5737,7 @@ void ReplicatedPG::apply_and_flush_repops(bool requeue)
   }
 
   if (requeue) {
-    waiting_for_map.splice(waiting_for_map.end(), rq);
+    requeue_ops(rq);
   }
 }
 
@@ -5771,14 +5771,13 @@ void ReplicatedPG::on_activate()
 void ReplicatedPG::on_change()
 {
   dout(10) << "on_change" << dendl;
-  apply_and_flush_repops(is_primary());
 
   clear_scrub_reserved();
   scrub_clear_state();
 
   context_registry_on_change();
 
-  // take object waiters
+  // requeue object waiters
   requeue_object_waiters(waiting_for_missing_object);
   for (map<hobject_t,list<OpRequestRef> >::iterator p = waiting_for_degraded_object.begin();
        p != waiting_for_degraded_object.end();
@@ -5786,9 +5785,13 @@ void ReplicatedPG::on_change()
     requeue_ops(p->second);
     finish_degraded_object(p->first);
   }
+
   requeue_ops(waiting_for_all_missing);
   waiting_for_all_missing.clear();
 
+  // this will requeue ops we were working on but didn't finish
+  apply_and_flush_repops(is_primary());
+
   // clear pushing/pulling maps
   pushing.clear();
   pulling.clear();