]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: move self tid generatation to shard_service
authorchunmei-liu <chunmei.liu@intel.com>
Wed, 25 May 2022 23:46:52 +0000 (16:46 -0700)
committerchunmei-liu <chunmei.liu@intel.com>
Wed, 8 Jun 2022 22:48:53 +0000 (15:48 -0700)
Signed-off-by: chunmei-liu <chunmei.liu@intel.com>
src/crimson/osd/replicated_backend.cc
src/crimson/osd/replicated_backend.h
src/crimson/osd/shard_services.h

index 0802ec5abc4715ab8a93f7c1c3d341c0a8c9a43d..894d606752975619c4619a6a29a501b1c5208097 100644 (file)
@@ -53,7 +53,7 @@ ReplicatedBackend::_submit_transaction(std::set<pg_shard_t>&& pg_shards,
     throw crimson::common::actingset_changed(peering->is_primary);
   }
 
-  const ceph_tid_t tid = next_txn_id++;
+  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;
   bufferlist encoded_txn;
index fce98fbd0c62a6516954c422f78a0a914ab56120..88fa85ede7eb060fdef67db37519762027a30cf4 100644 (file)
@@ -37,7 +37,6 @@ private:
     std::vector<pg_log_entry_t>&& log_entries) final;
   const pg_t pgid;
   const pg_shard_t whoami;
-  ceph_tid_t next_txn_id = 0;
   class pending_on_t : public seastar::weakly_referencable<pending_on_t> {
   public:
     pending_on_t(size_t pending, const eversion_t& at_version)
index faacc196f374d6c898f7f910fb429377bb5ab3eb..6913a52cbb576f23a930ab57b7dec9c785e0196f 100644 (file)
@@ -139,6 +139,13 @@ public:
     return dispatch_context({}, std::move(ctx));
   }
 
+  // -- tids --
+  // for ops i issue
+  unsigned int last_tid{0};
+  ceph_tid_t get_tid() {
+    return (ceph_tid_t)last_tid++;
+  }
+
   // PG Temp State
 private:
   // TODO: hook into map processing and some kind of heartbeat/peering