From 9a3516532d1108758c32795f7f3c1b147c4638fb Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Wed, 24 Apr 2024 17:00:53 +0800 Subject: [PATCH] crimson/os/seastore/transaction_manager: fix write pipeline phase leak 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 (cherry picked from commit 6a6f340c09a8dfe4565e298db11a30345ef7f82f) --- src/crimson/os/seastore/transaction.h | 2 ++ src/crimson/os/seastore/transaction_manager.cc | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crimson/os/seastore/transaction.h b/src/crimson/os/seastore/transaction.h index a283982f699..cac12d71b3a 100644 --- a/src/crimson/os/seastore/transaction.h +++ b/src/crimson/os/seastore/transaction.h @@ -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 { diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index 348c43e3c82..2490d715ad7 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -392,8 +392,6 @@ TransactionManager::do_submit_transaction( ceph_assert(0 == "Hit error submitting to journal"); }) ); - }).finally([&tref]() { - tref.get_handle().exit(); }); } -- 2.39.5