]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg: also trigger callbacks for empty peering transactions
authorXuehan Xu <xuxuehan@qianxin.com>
Tue, 24 Sep 2024 23:44:46 +0000 (07:44 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 25 Sep 2024 02:50:21 +0000 (10:50 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/osd/shard_services.cc

index 5f7c4a624471b1984269dd33485d24c50f6d4be6..df6d10d6aa7d205ea2aff3d364e9e84fb83265fe 100644 (file)
@@ -767,14 +767,20 @@ seastar::future<> ShardServices::dispatch_context_transaction(
   LOG_PREFIX(OSDSingletonState::dispatch_context_transaction);
   if (ctx.transaction.empty()) {
     DEBUG("empty transaction");
-    return seastar::now();
+    co_await get_store().flush(col);
+    Context* on_commit(
+      ceph::os::Transaction::collect_all_contexts(ctx.transaction));
+    if (on_commit) {
+      on_commit->complete(0);
+    }
+    co_return;
   }
 
   DEBUG("do_transaction ...");
-  auto ret = get_store().do_transaction(
+  co_await get_store().do_transaction(
     col,
     ctx.transaction.claim_and_reset());
-  return ret;
+  co_return;
 }
 
 seastar::future<> ShardServices::dispatch_context_messages(