From: xinxin shu Date: Tue, 26 Aug 2014 05:37:14 +0000 (+0800) Subject: fix wrong value of op_w_latency perf counter X-Git-Tag: v0.86~211^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f3bf24687f00127c399fd243a4a725e5d36623bc;p=ceph.git fix wrong value of op_w_latency perf counter Fixes: #9217 Signed-off-by: xinxin shu --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7682c9837aca..36c20c662be7 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6781,7 +6781,10 @@ void ReplicatedPG::eval_repop(RepGather *repop) // ondisk? if (repop->all_committed) { - log_op_stats(repop->ctx); + if (!repop->log_op_stat) { + log_op_stats(repop->ctx); + repop->log_op_stat = true; + } publish_stats_to_osd(); // send dup commits, in order diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 324ca42ed234..c9399b499256 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -618,6 +618,7 @@ public: bool queue_snap_trimmer; Context *on_applied; + bool log_op_stat; RepGather(OpContext *c, ObjectContextRef pi, ceph_tid_t rt, eversion_t lc) : @@ -631,7 +632,8 @@ public: sent_disk(false), pg_local_last_complete(lc), queue_snap_trimmer(false), - on_applied(NULL) { } + on_applied(NULL), + log_op_stat(false) { } RepGather *get() { nref++;