instead of querying 'planned scrub' flags.
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
m_flags.check_repair = m_active_target->urgency() == urgency_t::after_repair;
m_flags.auto_repair = false;
- m_flags.priority = (request.must_scrub || request.need_auto)
- ? get_pg_cct()->_conf->osd_requested_scrub_priority
- : m_pg->get_scrub_priority();
+ if (ScrubJob::has_high_queue_priority(m_active_target->urgency())) {
+ // specific high priority scrubs - high queue priority
+ /// \todo consider - do we really want high queue priority for any scrub?
+ m_flags.priority = get_pg_cct()->_conf->osd_requested_scrub_priority;
+ } else {
+ // regular, low-priority scrubs - low queue priority - unless blocking
+ // client I/O
+ m_flags.priority = m_pg->get_scrub_priority();
+ }
// 'deep-on-error' is set for periodic shallow scrubs, if allowed
// by the environment
if (pg_cond.can_autorepair || request.auto_repair) {
m_flags.auto_repair = true;
}
- } else {
- ceph_assert(!request.must_deep_scrub);
- ceph_assert(!request.need_auto);
}
// m_is_repair is set for either 'must_repair' or 'repair-on-the-go' (i.e.
auto& sh_times = shallow_target.sched_info.schedule; // shorthand
- if (!ScrubJob::requires_randomization(shallow_target.urgency())) {
- // the target time is already set. Make sure to reset the n.b. and
- // the (irrelevant) deadline
- sh_times.not_before = sh_times.scheduled_at;
- sh_times.deadline = sh_times.scheduled_at;
-
- } else {
+ if (ScrubJob::requires_randomization(shallow_target.urgency())) {
utime_t adj_not_before = last_scrub;
utime_t adj_target = last_scrub;
sh_times.deadline = adj_target;
}
sh_times.scheduled_at = adj_target;
sh_times.not_before = adj_not_before;
+
+ } else {
+
+ // the target time is already set. Make sure to reset the n.b. and
+ // the (irrelevant) deadline
+ sh_times.not_before = sh_times.scheduled_at;
+ sh_times.deadline = sh_times.scheduled_at;
}
dout(10) << fmt::format(
{
return urgency < urgency_t::operator_requested;
}
+
+bool ScrubJob::has_high_queue_priority(urgency_t urgency)
+{
+ return urgency >= urgency_t::operator_requested;
+}
static bool observes_random_backoff(urgency_t urgency);
static bool observes_recovery(urgency_t urgency);
+
+ static bool has_high_queue_priority(urgency_t urgency);
};
} // namespace Scrub