From 87d188b848fc953a019935e5ae078ec09a1e56a5 Mon Sep 17 00:00:00 2001 From: Xinze Chi Date: Fri, 3 Nov 2017 11:12:52 +0800 Subject: [PATCH] osd/PrimaryLogPG: fix dup stat for async read The async read would call do_osd_ops twice. Signed-off-by: Xinze Chi --- src/osd/PrimaryLogPG.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index ac3db593e6722..712743028e8f6 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -7445,7 +7445,8 @@ int PrimaryLogPG::prepare_transaction(OpContext *ctx) // read-op? write-op noop? done? if (ctx->op_t->empty() && !ctx->modify) { - unstable_stats.add(ctx->delta_stats); + if (ctx->pending_async_reads.empty()) + unstable_stats.add(ctx->delta_stats); if (ctx->op->may_write() && get_osdmap()->require_osd_release >= CEPH_RELEASE_KRAKEN) { ctx->update_log_only = true; -- 2.39.5