std::chrono::milliseconds OsdScrub::scrub_sleep_time(
- utime_t t,
- bool high_priority_scrub) const
+ utime_t t_now,
+ bool scrub_respects_ext_sleep) const
{
const milliseconds regular_sleep_period =
milliseconds{int64_t(std::max(0.0, 1'000 * conf->osd_scrub_sleep))};
- if (high_priority_scrub || scrub_time_permit(t)) {
+ if (!scrub_respects_ext_sleep || scrub_time_permit(t_now)) {
return regular_sleep_period;
}
* chunks.
*
* Implementation Note: Returned value is either osd_scrub_sleep or
- * osd_scrub_extended_sleep, depending on must_scrub_param and time
- * of day (see configs osd_scrub_begin*)
+ * osd_scrub_extended_sleep:
+ * - if scrubs are allowed at this point in time - osd_scrub_sleep; otherwise
+ * (i.e. - the current time is outside of the allowed scrubbing hours/days,
+ * but the scrub started earlier):
+ * - if the scrub observes "extended sleep" (i.e. - it's a low urgency
+ * scrub) - osd_scrub_extended_sleep.
*/
std::chrono::milliseconds scrub_sleep_time(
- utime_t t,
- bool high_priority_scrub) const;
+ utime_t t_now,
+ bool scrub_respects_ext_sleep) const;
/**
{
return m_osds->get_scrub_services().scrub_sleep_time(
ceph_clock_now(),
- !ScrubJob::observes_allowed_hours(m_active_target->urgency()));
+ ScrubJob::observes_extended_sleep(m_active_target->urgency()));
}
void PgScrubber::queue_for_scrub_resched(Scrub::scrub_prio_t prio)
return urgency < urgency_t::operator_requested;
}
+bool ScrubJob::observes_extended_sleep(urgency_t urgency)
+{
+ return urgency == urgency_t::periodic_regular;
+}
+
bool ScrubJob::observes_load_limit(urgency_t urgency)
{
return urgency < urgency_t::after_repair;
* | limitation | must- | after-repair |repairing| operator | must-repair |
* | | scrub |(aft recovery)|(errors) | request | |
* +------------+---------+--------------+---------+----------+-------------+
- * | reservation| yes! | no | no? + no | no |
- * | dow/time | yes | yes | no + no | no |
- * | ext-sleep | no | no | no + no | no |
- * | load | yes | no | no + no | no |
- * | noscrub | yes | no? | Yes + no | no |
- * | max-scrubs | yes | yes | Yes + no | no |
- * | backoff | yes | no | no + no | no |
- * | recovery | yes | yes | Yes + no | no |
+ * | reservation| yes! | no | no? | no | no |
+ * | dow/time | yes | yes | no | no | no |
+ * | ext-sleep | no | no | no | no | no |
+ * | load | yes | no | no | no | no |
+ * | noscrub | yes | no | Yes | no | no |
+ * | max-scrubs | yes | yes | Yes | no | no |
+ * | backoff | yes | no | no | no | no |
+ * | recovery | yes | yes | Yes | no | no |
* +------------+---------+--------------+---------+----------+-------------+
*/
static bool observes_allowed_hours(urgency_t urgency);
+ static bool observes_extended_sleep(urgency_t urgency);
+
static bool observes_load_limit(urgency_t urgency);
static bool requires_reservation(urgency_t urgency);