]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: set op->paused in recalc_op_target(), resend in not paused
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 7 Nov 2013 00:15:47 +0000 (16:15 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Thu, 7 Nov 2013 00:49:43 +0000 (16:49 -0800)
When going through scan_requests() in handle_osd_map() we need to make
sure that if an op should not be paused anymore then set it on the op
itself, and return NEED_RESEND. Otherwise we're going to miss reset of
the full flag.
Also in handle_osd_map(), make sure that op shouldn't be paused before
sending it. There's a lot of cleanup around that area that we should
probably be doing, make the code much more tight.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/osdc/Objecter.cc

index 286c03dd2d6f21fb502a4af2e67870731c3a929f..9d1d962dd58140af9836155b08ba58db1bc782d3 100644 (file)
@@ -654,7 +654,10 @@ void Objecter::handle_osd_map(MOSDMap *m)
   for (map<tid_t, Op*>::iterator p = need_resend.begin(); p != need_resend.end(); ++p) {
     Op *op = p->second;
     if (op->should_resend) {
-      if (op->session) {
+      bool paused = op->paused &&
+        (((op->flags & CEPH_OSD_FLAG_READ) && pauserd) ||
+         ((op->flags & CEPH_OSD_FLAG_WRITE) && pausewr));
+      if (op->session && !paused) {
        logger->inc(l_osdc_op_resend);
        send_op(op);
       }
@@ -1361,6 +1364,17 @@ int Objecter::recalc_op_target(Op *op)
   }
   osdmap->pg_to_acting_osds(pgid, acting);
 
+  bool paused = ((op->flags & CEPH_OSD_FLAG_WRITE && osdmap->test_flag(CEPH_OSDMAP_PAUSEWR)) ||
+      (op->flags & CEPH_OSD_FLAG_READ && osdmap->test_flag(CEPH_OSDMAP_PAUSERD)) ||
+      (op->flags & CEPH_OSD_FLAG_WRITE && osdmap->test_flag(CEPH_OSDMAP_FULL)));
+
+  bool need_resend = false;
+
+  if (!paused && paused != op->paused) {
+    op->paused = false;
+    need_resend = true;
+  }
+
   if (op->pgid != pgid || is_pg_changed(op->acting, acting, op->used_replica)) {
     op->pgid = pgid;
     op->acting = acting;
@@ -1408,6 +1422,9 @@ int Objecter::recalc_op_target(Op *op)
       else
        num_homeless_ops++;
     }
+    need_resend = true;
+  }
+  if (need_resend) {
     return RECALC_OP_TARGET_NEED_RESEND;
   }
   return RECALC_OP_TARGET_NO_ACTION;