From 9ff1255d924eea258fb9a469529ffc60a3cffe17 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Wed, 30 Nov 2022 14:33:37 +0000 Subject: [PATCH] crimson/osd/osd_operations/client_request: Remove seq_mode_t No longer in use. See 5aa342c9f08df251917020d2a0970f94d9d66ec0 Signed-off-by: Matan Breizman --- .../osd/osd_operations/client_request.cc | 74 +++++++------------ .../osd/osd_operations/client_request.h | 9 +-- 2 files changed, 27 insertions(+), 56 deletions(-) diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index 858c2dd9843..87f28a482d2 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -151,10 +151,7 @@ seastar::future<> ClientRequest::with_pg_int( if (is_pg_op()) { return process_pg_op(pgref); } else { - return process_op( - ihref, - pgref - ).then_interruptible([](auto){}); + return process_op(ihref, pgref); } }).then_interruptible([this, this_instance_id, pgref] { logger().debug("{}.{}: after process*", *this, this_instance_id); @@ -203,13 +200,10 @@ auto ClientRequest::reply_op_error(const Ref& pg, int err) !m->has_flag(CEPH_OSD_FLAG_RETURNVEC)); reply->set_reply_versions(eversion_t(), 0); reply->set_op_returns(std::vector{}); - return conn->send(std::move(reply)).then([] { - return seastar::make_ready_future - (seq_mode_t::OUT_OF_ORDER); - }); + return conn->send(std::move(reply)); } -ClientRequest::interruptible_future +ClientRequest::interruptible_future<> ClientRequest::process_op(instance_handle_t &ihref, Ref &pg) { return ihref.enter_stage( @@ -221,55 +215,39 @@ ClientRequest::process_op(instance_handle_t &ihref, Ref &pg) }).then_interruptible([this, pg, &ihref]() mutable { return pg->already_complete(m->get_reqid()).then_interruptible( [this, pg, &ihref](auto completed) mutable - -> PG::load_obc_iertr::future { + -> PG::load_obc_iertr::future<> { if (completed) { auto reply = crimson::make_message( m.get(), completed->err, pg->get_osdmap_epoch(), CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK, false); reply->set_reply_versions(completed->version, completed->user_version); - return conn->send(std::move(reply)).then([] { - return seastar::make_ready_future(seq_mode_t::OUT_OF_ORDER); - }); + return conn->send(std::move(reply)); } else { return ihref.enter_stage(pp(*pg).get_obc, *this ).then_interruptible( - [this, pg, &ihref]() mutable -> PG::load_obc_iertr::future { + [this, pg, &ihref]() mutable -> PG::load_obc_iertr::future<> { logger().debug("{}: got obc lock", *this); op_info.set_from_op(&*m, *pg->get_osdmap()); - // XXX: `do_with()` is just a workaround for `with_obc_func_t` imposing - // `future`. - return seastar::do_with( - seq_mode_t{}, - [this, &pg, &ihref](seq_mode_t& mode) { - return pg->with_locked_obc( - m->get_hobj(), op_info, - [this, pg, &mode, &ihref](auto obc) mutable { - return ihref.enter_stage(pp(*pg).process, *this - ).then_interruptible( - [this, pg, obc, &mode, &ihref]() mutable { - return do_process(ihref, pg, obc - ).then_interruptible([&mode] (seq_mode_t _mode) { - mode = _mode; - return seastar::now(); - }); - }); - }).safe_then_interruptible([&mode] { - return PG::load_obc_iertr::make_ready_future(mode); - }); - }); - }); + return pg->with_locked_obc( + m->get_hobj(), op_info, + [this, pg, &ihref](auto obc) mutable { + return ihref.enter_stage(pp(*pg).process, *this + ).then_interruptible([this, pg, obc, &ihref]() mutable { + return do_process(ihref, pg, obc); + }); + }); + }); } - }); - }).safe_then_interruptible([pg] (const seq_mode_t mode) { - return seastar::make_ready_future(mode); - }, PG::load_obc_ertr::all_same_way([this, pg=std::move(pg)](const auto &code) { - logger().error("ClientRequest saw error code {}", code); - assert(code.value() > 0); - return reply_op_error(pg, -code.value()); + }); + }).handle_error_interruptible( + PG::load_obc_ertr::all_same_way([this, pg=std::move(pg)](const auto &code) { + logger().error("ClientRequest saw error code {}", code); + assert(code.value() > 0); + return reply_op_error(pg, -code.value()); })); } -ClientRequest::interruptible_future +ClientRequest::interruptible_future<> ClientRequest::do_process( instance_handle_t &ihref, Ref& pg, crimson::osd::ObjectContextRef obc) @@ -278,7 +256,7 @@ ClientRequest::do_process( // primary can handle both normal ops and balanced reads if (is_misdirected(*pg)) { logger().trace("do_process: dropping misdirected op"); - return seastar::make_ready_future(seq_mode_t::OUT_OF_ORDER); + return seastar::now(); } else if (const hobject_t& hoid = m->get_hobj(); !pg->get_peering_state().can_serve_replica_read(hoid)) { return reply_op_error(pg, -EAGAIN); @@ -292,7 +270,7 @@ ClientRequest::do_process( // drop op on the floor; the client will handle returning EIO if (m->has_flag(CEPH_OSD_FLAG_SUPPORTSPOOLEIO)) { logger().debug("discarding op due to pool EIO flag"); - return seastar::make_ready_future(seq_mode_t::IN_ORDER); + return seastar::now(); } else { logger().debug("replying EIO due to pool EIO flag"); return reply_op_error(pg, -EIO); @@ -327,9 +305,7 @@ ClientRequest::do_process( ).then_interruptible( [this, reply=std::move(reply)]() mutable { logger().debug("{}: sending response", *this); - return conn->send(std::move(reply)).then([] { - return seastar::make_ready_future(seq_mode_t::IN_ORDER); - }); + return conn->send(std::move(reply)); }); }, crimson::ct_error::eagain::handle([this, pg, &ihref]() mutable { return process_op(ihref, pg); diff --git a/src/crimson/osd/osd_operations/client_request.h b/src/crimson/osd/osd_operations/client_request.h index 16226fb61b3..1646a050a17 100644 --- a/src/crimson/osd/osd_operations/client_request.h +++ b/src/crimson/osd/osd_operations/client_request.h @@ -214,12 +214,7 @@ private: interruptible_future<> with_sequencer(FuncT&& func); auto reply_op_error(const Ref& pg, int err); - enum class seq_mode_t { - IN_ORDER, - OUT_OF_ORDER - }; - - interruptible_future do_process( + interruptible_future<> do_process( instance_handle_t &ihref, Ref& pg, crimson::osd::ObjectContextRef obc); @@ -227,7 +222,7 @@ private: ::crimson::osd::IOInterruptCondition> process_pg_op( Ref &pg); ::crimson::interruptible::interruptible_future< - ::crimson::osd::IOInterruptCondition, seq_mode_t> process_op( + ::crimson::osd::IOInterruptCondition> process_op( instance_handle_t &ihref, Ref &pg); bool is_pg_op() const; -- 2.39.5