}
}
-bool PG::get_must_scrub() const
-{
- dout(20) << __func__ << " must_scrub? " << (m_planned_scrub.must_scrub ? "true" : "false") << dendl;
- return m_planned_scrub.must_scrub;
-}
-
unsigned int PG::scrub_requeue_priority(Scrub::scrub_prio_t with_priority) const
{
return m_scrubber->scrub_requeue_priority(with_priority);
void shutdown();
virtual void on_shutdown() = 0;
- bool get_must_scrub() const;
-
Scrub::schedule_result_t start_scrubbing(
const Scrub::SchedEntry& candidate,
Scrub::OSDRestrictions osd_restrictions);
}
-void PgScrubber::flags_to_shallow_priority(
- const Scrub::sched_conf_t& app_conf,
- utime_t scrub_clock_now)
-{
- auto& entry = m_scrub_job->shallow_target.sched_info_ref();
-
- if (m_planned_scrub.must_scrub) {
-
- // Set the smallest time that isn't utime_t()
- entry.schedule.scheduled_at = PgScrubber::scrub_must_stamp();
- ///\todo missing a distinct urgency level for 'must' scrubs
- entry.urgency = urgency_t::operator_requested;
-
- } else if (m_pg->info.stats.stats_invalid && app_conf.mandatory_on_invalid) {
- entry.schedule.scheduled_at = scrub_clock_now;
- entry.urgency = urgency_t::operator_requested;
- }
-}
-
-
void PgScrubber::update_targets(
const requested_scrub_t& planned,
utime_t scrub_clock_now)
// first, use the planned-scrub flags to possibly set one of the
// targets as high-priority.
// Note - this step is to be removed in the followup commits.
- auto deep_hp_set = flags_to_deep_priority(applicable_conf, scrub_clock_now);
- if (!deep_hp_set) {
- flags_to_shallow_priority(populate_config_params(), scrub_clock_now);
+ flags_to_deep_priority(applicable_conf, scrub_clock_now);
+
+ if (m_pg->info.stats.stats_invalid && applicable_conf.mandatory_on_invalid) {
+ m_scrub_job->shallow_target.sched_info_ref().schedule.scheduled_at =
+ scrub_clock_now;
+ m_scrub_job->shallow_target.up_urgency_to(urgency_t::must_scrub);
}
// the next periodic scrubs:
const Scrub::sched_conf_t& app_conf,
utime_t scrub_clock_now);
- /**
- * use the 'planned scrub' flags to determine the urgency attribute
- * of the 'shallow target' part of the ScrubJob object.
- */
- void flags_to_shallow_priority(
- const Scrub::sched_conf_t& app_conf,
- utime_t scrub_clock_now);
-
/**
* recompute the two ScrubJob targets, taking into account not
* only the up-to-date 'last' stamps, but also the 'planned scrub'