]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg: move maybe_submit_error_log 54765/head
authorMatan Breizman <mbreizma@redhat.com>
Wed, 20 Dec 2023 08:29:45 +0000 (08:29 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 16 Jan 2024 12:42:58 +0000 (12:42 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/pg.cc

index 8304697d5683c17ce00a207489c6c54f48c9bb0f..3813b882a3d5b18cd736ea93b8eaa397a5cd7aa3 100644 (file)
@@ -821,16 +821,6 @@ PG::do_osd_ops_execute(
     return obc_loader.reload_obc(obc).handle_error_interruptible(
       load_obc_ertr::assert_all{"can't live with object state messed up"});
   });
-  auto maybe_submit_error_log = [&, op_info, m, obc]
-    (const std::error_code& e, const ceph_tid_t& rep_tid) {
-    // call submit_error_log only for non-internal clients
-    if constexpr (!std::is_same_v<Ret, void>) {
-      if(op_info.may_write()) {
-        return submit_error_log(m, op_info, obc, e, rep_tid);
-      }
-    }
-    return seastar::make_ready_future<std::optional<eversion_t>>(std::nullopt);
-  };
   auto failure_func_ptr = seastar::make_lw_shared(std::move(failure_func));
   return interruptor::do_for_each(ops, [ox](OSDOp& osd_op) {
     logger().debug(
@@ -927,16 +917,24 @@ PG::do_osd_ops_execute(
       std::move(all_completed_fut)
     );
   }, OpsExecuter::osd_op_errorator::all_same_way(
-    [this, maybe_submit_error_log=std::move(maybe_submit_error_log),
+    [this, op_info, m, obc,
      rollbacker, failure_func_ptr]
     (const std::error_code& e) mutable {
-
     ceph_tid_t rep_tid = shard_services.get_tid();
     return rollbacker.rollback_obc_if_modified(e).then_interruptible(
-    [maybe_submit_error_log=std::move(maybe_submit_error_log),
+    [&, op_info, m, obc,
      this, e, rep_tid, failure_func_ptr] {
       // record error log
-      return maybe_submit_error_log(e, rep_tid).then(
+      auto maybe_submit_error_log =
+        seastar::make_ready_future<std::optional<eversion_t>>(std::nullopt);
+      // call submit_error_log only for non-internal clients
+      if constexpr (!std::is_same_v<Ret, void>) {
+        if(op_info.may_write()) {
+          maybe_submit_error_log =
+            submit_error_log(m, op_info, obc, e, rep_tid);
+        }
+      }
+      return maybe_submit_error_log.then(
       [this, failure_func_ptr, e, rep_tid] (auto version) {
         auto all_completed =
         [this, failure_func_ptr, e, rep_tid,  version] {