if (!is_primary())
return;
- if (m_scrubber) {
- recovery_state.update_stats_wo_resched(
- [scrubber = m_scrubber.get()](pg_history_t& hist,
- pg_stat_t& info) mutable -> void {
- info.scrub_sched_status = scrubber->get_schedule();
- });
- }
+ ceph_assert(m_scrubber);
+ recovery_state.update_stats_wo_resched(
+ [scrubber = m_scrubber.get()](pg_history_t& hist,
+ pg_stat_t& info) mutable -> void {
+ info.scrub_sched_status = scrubber->get_schedule();
+ });
std::lock_guard l{pg_stats_publish_lock};
auto stats =
<< (is_active() ? ") <active>" : ") <not-active>")
<< (is_clean() ? " <clean>" : " <not-clean>") << dendl;
ceph_assert(ceph_mutex_is_locked(_lock));
+ ceph_assert(m_scrubber);
if (is_scrub_queued_or_active()) {
return Scrub::schedule_result_t::already_started;
{
dout(20) << __func__ << " for a " << (is_primary() ? "Primary" : "non-primary") <<dendl;
- if (m_scrubber) {
- m_scrubber->on_maybe_registration_change(m_planned_scrub);
- }
+ ceph_assert(m_scrubber);
+ m_scrubber->on_maybe_registration_change(m_planned_scrub);
}
void PG::reschedule_scrub()
dout(20) << __func__ << " for a " << (is_primary() ? "Primary" : "non-primary") <<dendl;
// we are assuming no change in primary status
- if (is_primary() && m_scrubber) {
+ if (is_primary()) {
+ ceph_assert(m_scrubber);
m_scrubber->update_scrub_job(m_planned_scrub);
}
}
void PG::on_primary_status_change(bool was_primary, bool now_primary)
{
// make sure we have a working scrubber when becoming a primary
- ceph_assert(m_scrubber || !now_primary);
- if ((was_primary != now_primary) && m_scrubber) {
+ if (was_primary != now_primary) {
+ ceph_assert(m_scrubber);
m_scrubber->on_primary_change(m_planned_scrub);
}
}
void PG::scrub_requested(scrub_level_t scrub_level, scrub_type_t scrub_type)
{
- if (m_scrubber) {
- m_scrubber->scrub_requested(scrub_level, scrub_type, m_planned_scrub);
- }
+ ceph_assert(m_scrubber);
+ m_scrubber->scrub_requested(scrub_level, scrub_type, m_planned_scrub);
}
void PG::clear_ready_to_merge() {