]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/ops_executer: revoke OpsExecuter::get_obc()
authorXuehan Xu <xuxuehan@qianxin.com>
Sat, 14 Sep 2024 02:03:21 +0000 (10:03 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Sat, 14 Sep 2024 02:04:11 +0000 (10:04 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/osd/ops_executer.h
src/crimson/osd/pg.cc

index c06f6dd445aa5b329dcd3c55bd3a2b0fb1679371..d9281f7e4b670146f99f5090d9420d7a01ef6210 100644 (file)
@@ -572,10 +572,6 @@ OpsExecuter::flush_changes_n_do_ops_effects(
 template <class Func>
 struct OpsExecuter::RollbackHelper {
   void rollback_obc_if_modified(const std::error_code& e);
-  ObjectContextRef get_obc() const {
-    assert(ox);
-    return ox->obc;
-  }
   seastar::lw_shared_ptr<OpsExecuter> ox;
   Func func;
 };
index 50f994805dab7751d039feb60b366887e7a92544..80879279b45be91d93aa75c4bb0685c2c060f7d3 100644 (file)
@@ -1048,18 +1048,17 @@ PG::do_osd_ops_execute(
           std::move(log_entries));
     });
   }).safe_then_unpack_interruptible(
-    [success_func=std::move(success_func), rollbacker, this, failure_func_ptr]
+    [success_func=std::move(success_func), rollbacker, this, failure_func_ptr, obc]
     (auto submitted_fut, auto _all_completed_fut) mutable {
 
     auto all_completed_fut = _all_completed_fut.safe_then_interruptible_tuple(
       std::move(success_func),
       crimson::ct_error::object_corrupted::handle(
-      [rollbacker, this] (const std::error_code& e) mutable {
+      [rollbacker, this, obc] (const std::error_code& e) mutable {
       // this is a path for EIO. it's special because we want to fix the obejct
       // and try again. that is, the layer above `PG::do_osd_ops` is supposed to
       // restart the execution.
       rollbacker.rollback_obc_if_modified(e);
-      auto obc = rollbacker.get_obc();
       return repair_object(obc->obs.oi.soid,
                            obc->obs.oi.version
       ).then_interruptible([] {