From 0740e21e3248d227301d099d6778e94baf62a9e8 Mon Sep 17 00:00:00 2001 From: Zhang Song Date: Mon, 3 Apr 2023 19:15:21 +0800 Subject: [PATCH] crimson/os/seastore: ensure transaction commit order The previous implementation acquired the throttler first, which could result in an unordered wakeup sequence. Signed-off-by: Zhang Song --- src/crimson/os/seastore/seastore.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crimson/os/seastore/seastore.h b/src/crimson/os/seastore/seastore.h index bc4cce027f7..9ce77f7a826 100644 --- a/src/crimson/os/seastore/seastore.h +++ b/src/crimson/os/seastore/seastore.h @@ -233,10 +233,10 @@ private: transaction_manager->create_transaction(src, tname)), std::forward(f), [this, op_type](auto &ctx, auto &f) { - return throttler.get(1).then([&ctx] { - return ctx.transaction->get_handle().take_collection_lock( - static_cast(*(ctx.ch)).ordering_lock - ); + return ctx.transaction->get_handle().take_collection_lock( + static_cast(*(ctx.ch)).ordering_lock + ).then([this] { + return throttler.get(1); }).then([&, this] { return repeat_eagain([&, this] { ctx.reset_preserve_handle(*transaction_manager); -- 2.39.5