From aa31035e555129e56888320b84f16264f28bd7df Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 30 Mar 2012 16:14:05 -0700 Subject: [PATCH] osd: update_stats() on reads too Update pg stats on any op completion (read or write), not just writes. Do the calls with log_op_stats() for consistency's sake. Skip if the request was an error. Fixes: #2209 Signed-off-by: Sage Weil Reviewed-by: Samuel Just --- src/osd/ReplicatedPG.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 65fd56db9ee0e..b2e2a37325369 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -924,7 +924,10 @@ void ReplicatedPG::do_op(OpRequestRef op) // read or error? if (ctx->op_t.empty() || result < 0) { - log_op_stats(ctx); + if (result >= 0) { + log_op_stats(ctx); + update_stats(); + } MOSDOpReply *reply = ctx->reply; reply->set_version(info.last_update); @@ -3320,7 +3323,6 @@ void ReplicatedPG::op_applied(RepGather *repop) dout(10) << "requeueing scrub for cleanup" << dendl; osd->scrub_wq.queue(this); } - update_stats(); if (!repop->aborted) eval_repop(repop); @@ -3401,6 +3403,7 @@ void ReplicatedPG::eval_repop(RepGather *repop) if (repop->waitfor_disk.empty()) { log_op_stats(repop->ctx); + update_stats(); if (m->wants_ondisk() && !repop->sent_disk) { // send commit. -- 2.39.5