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 <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-12-12 13:32:52 -06:00
parent b0874dca54
commit 5668dee0d0

View File

@ -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--------*/