From: Yehuda Sadeh Date: Thu, 7 Nov 2013 00:15:47 +0000 (-0800) Subject: objecter: set op->paused in recalc_op_target(), resend in not paused X-Git-Tag: v0.75~112^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=98ab7d64a191371fa39d840c5f8e91cbaaa1d7b7;p=ceph.git objecter: set op->paused in recalc_op_target(), resend in not paused 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 --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 286c03dd2d6f..9d1d962dd581 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -654,7 +654,10 @@ void Objecter::handle_osd_map(MOSDMap *m) for (map::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;