]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/transaction_manager: fix write pipeline phase leak
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 24 Apr 2024 09:00:53 +0000 (17:00 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 16 May 2024 11:52:33 +0000 (14:52 +0300)
At present, if a transaction gets interrupted right after it enters
WritePipeline::ReserveProjectedUsage and before any later continuations
get executed, WritePipeline::ReserveProjectedUsage will be locked
forever.

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
(cherry picked from commit 6a6f340c09a8dfe4565e298db11a30345ef7f82f)

src/crimson/os/seastore/transaction.h
src/crimson/os/seastore/transaction_manager.cc

index a283982f699e19116be8cc0444dafbb98e2ffa85..cac12d71b3a9dfad03f7467d93c8d5580bbf8ec4 100644 (file)
@@ -385,6 +385,7 @@ public:
   }
 
   ~Transaction() {
+    get_handle().exit();
     on_destruct(*this);
     invalidate_clear_write_set();
   }
@@ -422,6 +423,7 @@ public:
     if (!has_reset) {
       has_reset = true;
     }
+    get_handle().exit();
   }
 
   bool did_reset() const {
index 348c43e3c8257cff683ee3c6a86d4538836364d7..2490d715ad70bb3b48d4ed692776ef9b1a4a362e 100644 (file)
@@ -392,8 +392,6 @@ TransactionManager::do_submit_transaction(
        ceph_assert(0 == "Hit error submitting to journal");
       })
     );
-  }).finally([&tref]() {
-      tref.get_handle().exit();
   });
 }