From: Sage Weil Date: Tue, 12 Dec 2017 19:32:52 +0000 (-0600) Subject: osd/PG: do not publish_stats_to_osd in state exit() methods X-Git-Tag: wip-pdonnell-testing-20180317.202121~553^2~16 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5668dee0d05244cd8a230a819e54a7d62bb6c688;p=ceph-ci.git osd/PG: do not publish_stats_to_osd in state exit() methods exit() can happen due to AdvMap and a peering interval change, but it runs before we have updated any of our internal state about whether we are the primary, whether our pool is deleted and the pg no longer exists, and so on. The publish depends on (1) being primary, and (2) will crash if the pool is gone from the OSDMap. Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 39beef8caf5..87fcace0db9 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -8125,7 +8125,6 @@ void PG::RecoveryState::GetInfo::exit() utime_t dur = ceph_clock_now() - enter_time; pg->osd->recoverystate_perf->tinc(rs_getinfo_latency, dur); pg->blocked_by.clear(); - pg->publish_stats_to_osd(); } /*------GetLog------------*/ @@ -8260,7 +8259,6 @@ void PG::RecoveryState::GetLog::exit() utime_t dur = ceph_clock_now() - enter_time; pg->osd->recoverystate_perf->tinc(rs_getlog_latency, dur); pg->blocked_by.clear(); - pg->publish_stats_to_osd(); } /*------WaitActingChange--------*/ @@ -8353,7 +8351,6 @@ void PG::RecoveryState::Down::exit() pg->osd->recoverystate_perf->tinc(rs_down_latency, dur); pg->blocked_by.clear(); - pg->publish_stats_to_osd(); } boost::statechart::result PG::RecoveryState::Down::react(const QueryState& q) @@ -8431,7 +8428,6 @@ void PG::RecoveryState::Incomplete::exit() pg->osd->recoverystate_perf->tinc(rs_incomplete_latency, dur); pg->blocked_by.clear(); - pg->publish_stats_to_osd(); } /*------GetMissing--------*/ @@ -8576,7 +8572,6 @@ void PG::RecoveryState::GetMissing::exit() utime_t dur = ceph_clock_now() - enter_time; pg->osd->recoverystate_perf->tinc(rs_getmissing_latency, dur); pg->blocked_by.clear(); - pg->publish_stats_to_osd(); } /*------WaitUpThru--------*/