@@ -40,7 +40,7 @@ namespace crimson::osd {
4040class PG ;
4141
4242// OpsExecuter -- a class for executing ops targeting a certain object.
43- class OpsExecuter : public seastar ::enable_lw_shared_from_this<OpsExecuter> {
43+ class OpsExecuter {
4444 friend class SnapTrimObjSubEvent ;
4545
4646 using call_errorator = crimson::errorator<
@@ -170,16 +170,12 @@ class OpsExecuter : public seastar::enable_lw_shared_from_this<OpsExecuter> {
170170
171171 object_stat_sum_t delta_stats;
172172private:
173- // an operation can be divided into two stages: main and effect-exposing
174- // one. The former is performed immediately on call to `do_osd_op()` while
175- // the later on `submit_changes()` – after successfully processing main
176- // stages of all involved operations. When any stage fails, none of all
177- // scheduled effect-exposing stages will be executed.
178- // when operation requires this division, some variant of `with_effect()`
179- // should be used.
173+ // with_effect can be used to schedule operations to be performed
174+ // at commit time. effects will be discarded if the operation does
175+ // not commit.
180176 struct effect_t {
181177 // an effect can affect PG, i.e. create a watch timeout
182- virtual osd_op_errorator ::future<> execute (Ref<PG> pg) = 0;
178+ virtual seastar ::future<> execute (Ref<PG> pg) = 0;
183179 virtual ~effect_t () = default ;
184180 };
185181
@@ -213,10 +209,10 @@ class OpsExecuter : public seastar::enable_lw_shared_from_this<OpsExecuter> {
213209 * execute_clone
214210 *
215211 * If snapc contains a snap which occurred logically after the last write
216- * seen by this object (see OpsExecutor ::should_clone()), we first need
212+ * seen by this object (see OpsExecuter ::should_clone()), we first need
217213 * make a clone of the object at its current state. execute_clone primes
218214 * txn with that clone operation and returns an
219- * OpsExecutor ::CloningContext which will allow us to fill in the corresponding
215+ * OpsExecuter ::CloningContext which will allow us to fill in the corresponding
220216 * metadata and log_entries once the operations have been processed.
221217 *
222218 * Note that this strategy differs from classic, which instead performs this
@@ -267,7 +263,7 @@ class OpsExecuter : public seastar::enable_lw_shared_from_this<OpsExecuter> {
267263 */
268264 void update_clone_overlap ();
269265
270- interruptible_future< std::vector<pg_log_entry_t > > flush_clone_metadata (
266+ std::vector<pg_log_entry_t > flush_clone_metadata (
271267 std::vector<pg_log_entry_t >&& log_entries,
272268 SnapMapper& snap_mapper,
273269 OSDriver& osdriver,
@@ -400,7 +396,7 @@ class OpsExecuter : public seastar::enable_lw_shared_from_this<OpsExecuter> {
400396 execute_op (OSDOp& osd_op);
401397
402398 using rep_op_fut_tuple =
403- std::tuple<interruptible_future<>, osd_op_ierrorator::future <>>;
399+ std::tuple<interruptible_future<>, interruptible_future <>>;
404400 using rep_op_fut_t =
405401 interruptible_future<rep_op_fut_tuple>;
406402 template <typename MutFunc>
@@ -475,7 +471,7 @@ auto OpsExecuter::with_effect_on_obc(
475471 effect_func (std::move(effect_func)),
476472 obc(std::move(obc)) {
477473 }
478- osd_op_errorator ::future<> execute (Ref<PG> pg) final {
474+ seastar ::future<> execute (Ref<PG> pg) final {
479475 return std::move (effect_func)(std::move (ctx),
480476 std::move (obc),
481477 std::move (pg));
@@ -502,15 +498,14 @@ OpsExecuter::flush_changes_n_do_ops_effects(
502498 assert (obc);
503499
504500 auto submitted = interruptor::now ();
505- auto all_completed =
506- interruptor::make_interruptible (osd_op_errorator::now ());
501+ auto all_completed = interruptor::now ();
507502
508503 if (cloning_ctx) {
509504 ceph_assert (want_mutate);
510505 }
511506
512507 if (want_mutate) {
513- auto log_entries = co_await flush_clone_metadata (
508+ auto log_entries = flush_clone_metadata (
514509 prepare_transaction (ops),
515510 snap_mapper,
516511 osdriver,
@@ -536,7 +531,7 @@ OpsExecuter::flush_changes_n_do_ops_effects(
536531 // need extra ref pg due to apply_stats() which can be executed after
537532 // informing snap mapper
538533 all_completed =
539- std::move (all_completed).safe_then_interruptible ([this , pg=this ->pg ] {
534+ std::move (all_completed).then_interruptible ([this , pg=this ->pg ] {
540535 // let's do the cleaning of `op_effects` in destructor
541536 return interruptor::do_for_each (op_effects,
542537 [pg=std::move (pg)](auto & op_effect) {
@@ -552,21 +547,19 @@ OpsExecuter::flush_changes_n_do_ops_effects(
552547
553548template <class Func >
554549struct OpsExecuter ::RollbackHelper {
555- void rollback_obc_if_modified (const std::error_code& e );
556- seastar::lw_shared_ptr< OpsExecuter> ox;
550+ void rollback_obc_if_modified ();
551+ OpsExecuter * ox;
557552 Func func;
558553};
559554
560555template <class Func >
561556inline OpsExecuter::RollbackHelper<Func>
562557OpsExecuter::create_rollbacker (Func&& func) {
563- return {shared_from_this () , std::forward<Func>(func)};
558+ return {this , std::forward<Func>(func)};
564559}
565560
566-
567561template <class Func >
568- void OpsExecuter::RollbackHelper<Func>::rollback_obc_if_modified(
569- const std::error_code& e)
562+ void OpsExecuter::RollbackHelper<Func>::rollback_obc_if_modified()
570563{
571564 // Oops, an operation had failed. do_osd_ops() altogether with
572565 // OpsExecuter already dropped the ObjectStore::Transaction if
@@ -584,10 +577,9 @@ void OpsExecuter::RollbackHelper<Func>::rollback_obc_if_modified(
584577 assert (ox);
585578 const auto need_rollback = ox->has_seen_write ();
586579 crimson::get_logger (ceph_subsys_osd).debug (
587- " {}: object {} got error {} , need_rollback={}" ,
580+ " {}: object {} got error, need_rollback={}" ,
588581 __func__,
589582 ox->obc ->get_oid (),
590- e,
591583 need_rollback);
592584 if (need_rollback) {
593585 func (ox->obc );
0 commit comments