From d4f6d210169c0db5fde09f8cf70a81bd187f1727 Mon Sep 17 00:00:00 2001 From: Amnon Hanuhov Date: Tue, 8 Dec 2020 12:57:16 -0500 Subject: [PATCH] crimson/osd_operations: Restart op processing if do_osd_ops returned eagain Signed-off-by: Amnon Hanuhov --- src/crimson/osd/osd_operations/client_request.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index 87b8fc788e3..3143dfc13ff 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -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::future> { 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 reply) { + }).safe_then([this](Ref 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(); -- 2.47.3