]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: trim backref cache before preparing record 46795/head
authorXuehan Xu <xxhdx1985126@gmail.com>
Fri, 17 Jun 2022 07:58:33 +0000 (15:58 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Wed, 22 Jun 2022 01:49:48 +0000 (09:49 +0800)
Otherwise, the transaction record would contain backrefs that has been
merged into the backref tree

Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/os/seastore/transaction_manager.cc

index 2f9bfe23e33f38365ea41bad256d09a200ad57d7..bd1ce25d1d44f581ca3fd23a2fbe19d5d79986c4 100644 (file)
@@ -355,6 +355,9 @@ TransactionManager::submit_transaction_direct(
     return tref.get_handle().enter(write_pipeline.prepare);
   }).si_then([this, FNAME, &tref, seq_to_trim=std::move(seq_to_trim)]() mutable
              -> submit_transaction_iertr::future<> {
+    if (seq_to_trim && *seq_to_trim != JOURNAL_SEQ_NULL) {
+      cache->trim_backref_bufs(*seq_to_trim);
+    }
     auto record = cache->prepare_record(tref, segment_cleaner.get());
 
     tref.get_handle().maybe_release_collection_lock();
@@ -365,9 +368,6 @@ TransactionManager::submit_transaction_direct(
       (auto submit_result) mutable {
       SUBDEBUGT(seastore_t, "committed with {}", tref, submit_result);
       auto start_seq = submit_result.write_result.start_seq;
-      if (seq_to_trim && *seq_to_trim != JOURNAL_SEQ_NULL) {
-       cache->trim_backref_bufs(*seq_to_trim);
-      }
       cache->complete_commit(
           tref,
           submit_result.record_block_base,