]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ECBackend: simplfy pg_committed_to handling
authorSamuel Just <sjust@redhat.com>
Sat, 30 Mar 2024 23:49:34 +0000 (16:49 -0700)
committerSamuel Just <sjust@redhat.com>
Sat, 19 Oct 2024 01:40:11 +0000 (01:40 +0000)
See comment for details. Modifies ECBackend::submit_transaction to
use the passed pg_committed_to unconditionally, adds a comment to
explain, and adds a comment to RMWPipeline::pg_committed_to to
clarify that it may lag PeeringState::pg_committed_to.

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

index cab6bbb3acbe450c169b21633e16b973c84280fe..fa2570aba42afa62d25148387b2dab87e01708f6 100644 (file)
@@ -1485,7 +1485,15 @@ void ECBackend::submit_transaction(
   op->delta_stats = delta_stats;
   op->version = at_version;
   op->trim_to = trim_to;
-  op->pg_committed_to = std::max(pg_committed_to, rmw_pipeline.committed_to);
+  /* We update PeeringState::pg_committed_to via the callback
+   * invoked from ECBackend::handle_sub_write_reply immediately
+   * before updating rmw_pipeline.commited_to via
+   * rmw_pipeline.check_ops()->try_finish_rmw(), so these will
+   * *usually* match.  However, the PrimaryLogPG::submit_log_entries
+   * pathway can perform an out-of-band log update which updates
+   * PeeringState::pg_committed_to independently.  Thus, the value
+   * passed in is the right one to use. */
+  op->pg_committed_to = pg_committed_to;
   op->log_entries = log_entries;
   std::swap(op->updated_hit_set_history, hset_history);
   op->on_all_commit = on_all_commit;
index 2727b76d24302bf2ae9d217c3730e58546eb2dd0..7ff9cae7646ab045a8111a6b1ba02e4e6dedeb2e 100644 (file)
@@ -522,7 +522,17 @@ struct ECCommon {
       osd_reqid_t reqid;
       ZTracer::Trace trace;
 
-      eversion_t pg_committed_to; /// Soon to be generated internally
+      /**
+       * pg_commited_to
+       *
+       * Represents a version v such that all v' < v handled by RMWPipeline
+       * have fully committed. This may actually lag
+       * PeeringState::pg_committed_to if PrimaryLogPG::submit_log_entries
+       * submits an out-of-band log update.
+       *
+       * Soon to be generated internally.
+       */
+      eversion_t pg_committed_to;
 
       /// Ancillary also provided from submit_transaction caller
       std::map<hobject_t, ObjectContextRef> obc_map;