]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: skip empty transaction in ShardServices::dispatch_context_transaction 44653/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 19 Jan 2022 07:47:43 +0000 (15:47 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 20 Jan 2022 05:11:38 +0000 (13:11 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/osd/pg.cc
src/crimson/osd/shard_services.cc

index 45ae1875b2be552e966ce056c309cc9437f6ff60..736e512c3703321ee1cd7aeeb80173417e00078f 100644 (file)
@@ -130,7 +130,7 @@ PG::PG(
 PG::~PG() {}
 
 bool PG::try_flush_or_schedule_async() {
-  logger().debug("PG::try_flush_or_schedule_async: do_transaction...");
+  logger().debug("PG::try_flush_or_schedule_async: flush ...");
   (void)shard_services.get_store().flush(
     coll_ref
   ).then(
index 17192e65d76a85e618d3ce95231906d464ce4714..b9d97b2b283b95ad5655c5691ce2a83ec88d35d8 100644 (file)
@@ -106,7 +106,12 @@ seastar::future<> ShardServices::send_to_osd(
 
 seastar::future<> ShardServices::dispatch_context_transaction(
   crimson::os::CollectionRef col, PeeringCtx &ctx) {
-  logger().debug("ShardServices::dispatch_context_transaction: do_transaction...");
+  if (ctx.transaction.empty()) {
+    logger().debug("ShardServices::dispatch_context_transaction: empty transaction");
+    return seastar::now();
+  }
+
+  logger().debug("ShardServices::dispatch_context_transaction: do_transaction ...");
   auto ret = store.do_transaction(
     col,
     std::move(ctx.transaction));