]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/transaction: drop the old trans-blocking mechinary
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 8 Jul 2026 07:15:27 +0000 (15:15 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Thu, 16 Jul 2026 08:44:17 +0000 (16:44 +0800)
This old trans-blocking mechinary can be hard to maintain in the future

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.cc
src/crimson/os/seastore/cached_extent.h
src/crimson/os/seastore/transaction.h
src/crimson/os/seastore/transaction_manager.cc

index 9500ffdbc61d048ea68926ae6c8996be19e190b4..bcc2adef7d1e3a3cd5114ff4f0dfc84aec232389 100644 (file)
@@ -1394,7 +1394,6 @@ record_t Cache::prepare_record(
     }
     if (should_use_no_conflict_publish(t, i->get_type())) {
       i->new_committer(t);
-      i->committer->block_trans(t);
     }
     assert(i->is_exist_mutation_pending() ||
           i->prior_instance);
@@ -1675,8 +1674,6 @@ record_t Cache::prepare_record(
       assert(!i->get_prior_instance()->committer);
       i->new_committer(t);
       assert(i->committer);
-      auto &committer = *i->committer;
-      committer.block_trans(t);
       i->get_prior_instance()->set_io_wait(
         CachedExtent::extent_state_t::CLEAN,
         should_use_no_conflict_publish(t, i->get_type()));
@@ -1711,8 +1708,6 @@ record_t Cache::prepare_record(
       i->new_committer(t);
       assert(i->committer);
       i->get_prior_instance()->committer = i->committer;
-      auto &committer = *i->committer;
-      committer.block_trans(t);
       i->get_prior_instance()->set_io_wait(
         CachedExtent::extent_state_t::CLEAN, true);
     }
@@ -2050,7 +2045,6 @@ void Cache::complete_commit(
       }
       touch_extent_fully(prior, &t_src, t.get_cache_hint());
       committer.sync_version();
-      committer.unblock_trans(t);
       prior.complete_io();
       i->committer.reset();
       prior.committer.reset();
@@ -2131,7 +2125,6 @@ void Cache::complete_commit(
       auto &committer = *i->committer;
       committer.commit_state();
       committer.sync_checksum();
-      committer.unblock_trans(t);
       auto &prior = *i->prior_instance;
       prior.pending_for_transaction = TRANS_ID_NULL;
       ceph_assert(prior.is_valid());
index 391ca6c454fddd5c4a570d78d593166366ec8384..09caf5f66352bbfe1ff11d3ca3a3034dc8764791 100644 (file)
@@ -515,24 +515,4 @@ void CachedExtent::new_committer(Transaction &t) {
   prior_instance->committer = committer;
 }
 
-void ExtentCommitter::block_trans(Transaction &t) {
-  LOG_PREFIX(ExtentCommitter::block_trans);
-  auto &prior = *extent.prior_instance;
-  for (auto &item : prior.read_transactions) {
-    TRACET("blocking trans {} for rewriting {}",
-      t, item.t->get_trans_id(), *item.ref);
-    item.t->need_wait_visibility = true;
-  }
-}
-
-void ExtentCommitter::unblock_trans(Transaction &t) {
-  LOG_PREFIX(ExtentCommitter::unblock_trans);
-  auto &prior = *extent.prior_instance;
-  for (auto &item : prior.read_transactions) {
-    TRACET("unblocking trans {} for rewriting {}",
-      t, item.t->get_trans_id(), *item.ref);
-    item.t->need_wait_visibility = false;
-  }
-}
-
 }
index 098fb1358dfaebe644230aa48a98f52aa3245d6e..e0325c6bf6083fe9e4bbac3f9c21c4a7360ec36b 100644 (file)
@@ -279,8 +279,6 @@ public:
   ExtentCommitter(CachedExtent &extent, Transaction &t)
     : extent(extent), t(t) {}
 
-  void block_trans(Transaction &);
-  void unblock_trans(Transaction &);
   // commit all extent states to the prior instance,
   // except poffset and extent content
   void commit_state();
index e88c2e7383012eab50901c97584e380a5a55d87f..99caa62dd80fb25610df64d44e53655d6012995a 100644 (file)
@@ -547,7 +547,6 @@ public:
     ool_write_stats = {};
     rewrite_stats = {};
     conflicted = false;
-    need_wait_visibility = false;
     force_rewrite_conflict = false;
     assert(backref_entries.empty());
     if (!has_reset) {
@@ -675,7 +674,6 @@ public:
 
   btree_cursor_stats_t cursor_stats;
 
-  bool need_wait_visibility = false;
   bool force_rewrite_conflict = false;
 
   using update_copied_lba_key_func_t =
index 10244545a2fcfe2695c525d78f938ac3763a4318..ae2b32cfd0dae6147b5c1812dff97e78f6cbe93c 100644 (file)
@@ -634,9 +634,6 @@ TransactionManager::do_submit_transaction(
   tref.get_phase_durations().prepare_enter +=
     std::chrono::steady_clock::now() - prepare_enter_start;
 
-  while (tref.need_wait_visibility) {
-    co_await trans_intr::make_interruptible(seastar::yield());
-  }
   if (trim_alloc_to && *trim_alloc_to != JOURNAL_SEQ_NULL) {
     SUBTRACET(seastore_t, "trim backref_bufs to {}", tref, *trim_alloc_to);
     cache->trim_backref_bufs(*trim_alloc_to);