]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: ensure transaction commit order 50839/head
authorZhang Song <zhangsong325@gmail.com>
Mon, 3 Apr 2023 11:15:21 +0000 (19:15 +0800)
committerZhang Song <zhangsong325@gmail.com>
Mon, 3 Apr 2023 11:15:21 +0000 (19:15 +0800)
The previous implementation acquired the throttler first,
which could result in an unordered wakeup sequence.

Signed-off-by: Zhang Song <zhangsong325@gmail.com>
src/crimson/os/seastore/seastore.h

index bc4cce027f78a5b28d5f9b89c5860604e2778fe6..9ce77f7a826c0add43bc3b796e688ad5ede1cbae 100644 (file)
@@ -233,10 +233,10 @@ private:
        transaction_manager->create_transaction(src, tname)),
       std::forward<F>(f),
       [this, op_type](auto &ctx, auto &f) {
-       return throttler.get(1).then([&ctx] {
-         return ctx.transaction->get_handle().take_collection_lock(
-           static_cast<SeastoreCollection&>(*(ctx.ch)).ordering_lock
-         );
+       return ctx.transaction->get_handle().take_collection_lock(
+         static_cast<SeastoreCollection&>(*(ctx.ch)).ordering_lock
+       ).then([this] {
+         return throttler.get(1);
        }).then([&, this] {
          return repeat_eagain([&, this] {
            ctx.reset_preserve_handle(*transaction_manager);