From a98a2619b3858fb1688f7ccf128490ca96642d0a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 27 Jul 2017 12:13:39 -0400 Subject: [PATCH] osdc/Objecter: unify disparate EAGAIN handling paths into one We had two different code paths for EAGAIN that both seemed to resend the same request again (with a new tid), but implemneted it in two different ways. Further, the first one was conditioned on the BALANCE_READS flag but not LOCALIZED_READS, which should (I think) be equivalent in this context. Unify them into a single path. Signed-off-by: Sage Weil --- src/osdc/Objecter.cc | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index fc870badd603e..b91cf4385a7b9 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -3415,30 +3415,17 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) if (rc == -EAGAIN) { ldout(cct, 7) << " got -EAGAIN, resubmitting" << dendl; - - if ((op->target.flags & CEPH_OSD_FLAG_BALANCE_READS) - && (op->target.acting_primary != op->target.osd)) { - if (op->onfinish) - num_in_flight--; - _session_op_remove(s, op); - sl.unlock(); - put_session(s); - - op->tid = 0; - op->target.flags &= ~CEPH_OSD_FLAG_BALANCE_READS; - op->target.pgid = pg_t(); - _op_submit(op, sul, NULL); - m->put(); - return; - } - - // new tid - s->ops.erase(op->tid); - op->tid = ++last_tid; - - _send_op(op); + if (op->onfinish) + num_in_flight--; + _session_op_remove(s, op); sl.unlock(); put_session(s); + + op->tid = 0; + op->target.flags &= ~(CEPH_OSD_FLAG_BALANCE_READS | + CEPH_OSD_FLAG_LOCALIZE_READS); + op->target.pgid = pg_t(); + _op_submit(op, sul, NULL); m->put(); return; } -- 2.39.5