]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: update_stats() on reads too
authorSage Weil <sage.weil@dreamhost.com>
Fri, 30 Mar 2012 23:14:05 +0000 (16:14 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 30 Mar 2012 23:14:05 +0000 (16:14 -0700)
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 <sage.weil@dreamhost.com>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/ReplicatedPG.cc

index 65fd56db9ee0ee2345ec9ae0891f235671ef3ee5..b2e2a37325369b19e85f9eec86d9f84b8bce0edc 100644 (file)
@@ -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.