From: Sage Weil Date: Thu, 3 Sep 2015 01:39:55 +0000 (-0400) Subject: osd/ReplicatedPG: use apply_ctx_stats() everywhere X-Git-Tag: v9.1.0~135^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75d9f584e224cb0e36445b6d87cd245793fa675d;p=ceph.git osd/ReplicatedPG: use apply_ctx_stats() everywhere We were open-coding the stats update in several places, and getting it wrong in most of them. Use a single helper to do it. Note that any repop must *either* call apply_ctx_stats() or finish_ctx() (which calls it for you). Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index c254ad5881a..09a5bf4068b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -8154,6 +8154,8 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) ctx->log.back().mod_desc.mark_unrollbackable(); } + // no ctx->delta_stats + // obc ref swallowed by repop! simple_repop_submit(repop); @@ -10702,7 +10704,7 @@ void ReplicatedPG::hit_set_remove_all() utime_t now = ceph_clock_now(cct); ctx->mtime = now; hit_set_trim(repop, 0); - info.stats.stats.add(ctx->delta_stats); + apply_ctx_stats(ctx); simple_repop_submit(repop); } @@ -10923,12 +10925,7 @@ void ReplicatedPG::hit_set_persist() hit_set_trim(repop, max); - info.stats.stats.add(ctx->delta_stats); - if (scrubber.active) { - if (cmp(oid, scrubber.start, get_sort_bitwise()) < 0) - scrub_cstat.add(ctx->delta_stats); - } - + apply_ctx_stats(ctx); simple_repop_submit(repop); } @@ -12167,13 +12164,14 @@ boost::statechart::result ReplicatedPG::TrimmingObjects::react(const SnapTrim&) assert(repop); repop->queue_snap_trimmer = true; - info.stats.stats.add(ctx->delta_stats); + pg->apply_ctx_stats(repop->ctx); repops.insert(repop->get()); pg->simple_repop_submit(repop); } return discard_event(); } + /* WaitingOnReplicasObjects */ ReplicatedPG::WaitingOnReplicas::WaitingOnReplicas(my_context ctx) : my_base(ctx),