From: Yingxin Cheng Date: Wed, 19 Jan 2022 07:47:43 +0000 (+0800) Subject: crimson/osd: skip empty transaction in ShardServices::dispatch_context_transaction X-Git-Tag: v18.0.0~1508^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F44653%2Fhead;p=ceph.git crimson/osd: skip empty transaction in ShardServices::dispatch_context_transaction Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 45ae1875b2be..736e512c3703 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -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( diff --git a/src/crimson/osd/shard_services.cc b/src/crimson/osd/shard_services.cc index 17192e65d76a..b9d97b2b283b 100644 --- a/src/crimson/osd/shard_services.cc +++ b/src/crimson/osd/shard_services.cc @@ -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));