]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: unify disparate EAGAIN handling paths into one 16627/head
authorSage Weil <sage@redhat.com>
Thu, 27 Jul 2017 16:13:39 +0000 (12:13 -0400)
committerSage Weil <sage@redhat.com>
Thu, 27 Jul 2017 16:13:39 +0000 (12:13 -0400)
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 <sage@redhat.com>
src/osdc/Objecter.cc

index fc870badd603e793eb0ac06cd18115b472500e9d..b91cf4385a7b9f86dbd9064e06c57b7455a4e199 100644 (file)
@@ -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;
   }