]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd_operations: Restart op processing if do_osd_ops returned eagain 37566/head
authorAmnon Hanuhov <ahanukov@redhat.com>
Tue, 8 Dec 2020 17:57:16 +0000 (12:57 -0500)
committerAmnon Hanuhov <ahanukov@redhat.com>
Mon, 18 Jan 2021 13:43:19 +0000 (15:43 +0200)
Signed-off-by: Amnon Hanuhov <ahanukov@redhat.com>
src/crimson/osd/osd_operations/client_request.cc

index 87b8fc788e35240b1a6b0068f80eb0d6a222c9c8..3143dfc13ffabc56ab897a2cbd9e93f42e3efc3c 100644 (file)
@@ -140,12 +140,13 @@ seastar::future<> ClientRequest::process_op(
     return seastar::now();
   }).then([this, &pg] {
     return with_blocking_future(handle.enter(pp(pg).get_obc));
-  }).then([this, &pg]() -> PG::load_obc_ertr::future<> {
+  }).then([this, &pg, &pgref]() -> PG::load_obc_ertr::future<> {
     op_info.set_from_op(&*m, *pg.get_osdmap());
-    return pg.with_locked_obc(m, op_info, this, [this, &pg](auto obc) {
+    return pg.with_locked_obc(m, op_info, this, [this, &pg, &pgref](auto obc) {
       return with_blocking_future(
         handle.enter(pp(pg).process)
-      ).then([this, &pg, obc] {
+      ).then([this, &pg, obc]() 
+          -> crimson::errorator<crimson::ct_error::eagain>::future<Ref<MOSDOpReply>> {
         if (!pg.is_primary()) {
            // primary can handle both normal ops and balanced reads
           if (is_misdirected(pg)) {
@@ -161,13 +162,15 @@ seastar::future<> ClientRequest::process_op(
           }
         }
         return pg.do_osd_ops(m, obc, op_info);
-      }).then([this](Ref<MOSDOpReply> reply) {
+      }).safe_then([this](Ref<MOSDOpReply> reply) {
         if (reply) {
           return conn->send(std::move(reply));
         } else {
           return seastar::now();
         }
-      });
+      }, crimson::ct_error::eagain::handle([this, &pgref] {
+        return process_op(pgref);
+      }));
     });
   }).safe_then([pgref=std::move(pgref)] {
     return seastar::now();