]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson: PG::submit_error_log returns eversion_t rather than optional
authorSamuel Just <sjust@redhat.com>
Fri, 20 Sep 2024 02:39:08 +0000 (19:39 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 15 Oct 2024 03:37:26 +0000 (20:37 -0700)
It seems like the motivation here was to allow do_osd_ops_execute to
communicate that it didn't submit an error log by making
maybe_submit_error_log a std::optional<eversion_t>.  However,
submit_error_log itself always returns a version.  Fix submit_error_log
and compensate in do_osd_ops_execute.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 8ab4e4e899b8e84050cdf3953e423f734573a2be..26d1fa883bbce56e3f9714906533e5a9771301a4 100644 (file)
@@ -1122,7 +1122,11 @@ PG::do_osd_ops_execute(
     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);
+          submit_error_log(
+           m, op_info, obc, e, rep_tid
+         ).then_interruptible([](auto &&e) {
+           return std::make_optional<eversion_t>(std::move(e));
+         });
       }
     }
     return maybe_submit_error_log.then_interruptible(
@@ -1175,7 +1179,7 @@ PG::interruptible_future<> PG::complete_error_log(const ceph_tid_t& rep_tid,
   return result;
 }
 
-PG::interruptible_future<std::optional<eversion_t>> PG::submit_error_log(
+PG::interruptible_future<eversion_t> PG::submit_error_log(
   Ref<MOSDOp> m,
   const OpInfo &op_info,
   ObjectContextRef obc,
@@ -1241,7 +1245,7 @@ PG::interruptible_future<std::optional<eversion_t>> PG::submit_error_log(
         get_collection_ref(), std::move(t)
       ).then([this] {
         peering_state.update_trim_to();
-        return seastar::make_ready_future<std::optional<eversion_t>>(projected_last_update);
+        return seastar::make_ready_future<eversion_t>(projected_last_update);
       });
     });
   });
index d8bbc56abcc46eb60ddb888d373497e822676262..5bd5c3aeff849b4afc130e5a442ee0c6fd4f714e 100644 (file)
@@ -621,7 +621,7 @@ public:
   void dump_primary(Formatter*);
   interruptible_future<> complete_error_log(const ceph_tid_t& rep_tid,
                                        const eversion_t& version);
-  interruptible_future<std::optional<eversion_t>> submit_error_log(
+  interruptible_future<eversion_t> submit_error_log(
     Ref<MOSDOp> m,
     const OpInfo &op_info,
     ObjectContextRef obc,