From: Xuehan Xu Date: Wed, 24 Apr 2024 09:00:53 +0000 (+0800) Subject: crimson/os/seastore/transaction_manager: fix write pipeline phase leak X-Git-Tag: testing/wip-lusov-testing-20240611.123850-squid~76^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9a3516532d1108758c32795f7f3c1b147c4638fb;p=ceph-ci.git 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) --- 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(); }); }