]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/replicated_backend: Introduce pending_shart_t::last_complete
authorMatan Breizman <mbreizma@redhat.com>
Wed, 5 Mar 2025 15:56:52 +0000 (15:56 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 6 Mar 2025 09:34:49 +0000 (09:34 +0000)
This will be used (next commit) once we'll call complete_write from
ReplicatedBackend and not from PG as we do now.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/osd/replicated_backend.cc
src/crimson/osd/replicated_backend.h

index 6c8abecffafd091370a42b63def57e56abd5f929..987432e08dbd295c150a0e299856488554a01a3b 100644 (file)
@@ -92,7 +92,11 @@ ReplicatedBackend::submit_transaction(
 
   const ceph_tid_t tid = shard_services.get_tid();
   auto pending_txn =
-    pending_trans.try_emplace(tid, pg_shards.size(), osd_op_p.at_version).first;
+    pending_trans.try_emplace(
+      tid,
+      pg_shards.size(),
+      osd_op_p.at_version,
+      pg.get_last_complete()).first;
   bufferlist encoded_txn;
   encode(txn, encoded_txn);
 
index d5844b23a0c886fc410c411ae9797dcda5ce28d1..ddd3bed1a6fe464788c52bd34121d534ff6f5733 100644 (file)
@@ -44,8 +44,13 @@ private:
   const pg_shard_t whoami;
   class pending_on_t : public seastar::weakly_referencable<pending_on_t> {
   public:
-    pending_on_t(size_t pending, const eversion_t& at_version)
-      : pending{static_cast<unsigned>(pending)}, at_version(at_version)
+    pending_on_t(
+      size_t pending,
+      const eversion_t& at_version,
+      const eversion_t& last_complete)
+      : pending{static_cast<unsigned>(pending)},
+       at_version(at_version),
+       last_complete(last_complete)
     {}
     unsigned pending;
     // The order of pending_txns' at_version must be the same as their
@@ -54,6 +59,7 @@ private:
     // way, client requests at_version must be updated synchorously/simultaneously
     // with ceph_tid_t.
     const eversion_t at_version;
+    const eversion_t last_complete;
     crimson::osd::acked_peers_t acked_peers;
     seastar::shared_promise<> all_committed;
   };