f->dump_stream("pgid") << e.pgid;
f->dump_stream("sched_time") << e.schedule.not_before;
f->dump_stream("orig_sched_time") << e.schedule.scheduled_at;
- f->dump_stream("deadline") << e.schedule.deadline;
f->dump_bool(
"forced",
e.schedule.scheduled_at == PgScrubber::scrub_must_stamp());
: "deep");
f->dump_stream("urgency") << fmt::format("{}", e.urgency);
f->dump_bool("eligible", e.schedule.not_before <= query_time);
- f->dump_bool("overdue", e.schedule.deadline < query_time);
f->dump_stream("last_issue") << fmt::format("{}", e.last_issue);
},
std::numeric_limits<int>::max());
configs.deep_interval =
deep_pool > 0.0 ? deep_pool : conf->osd_deep_scrub_interval;
- /**
- * 'max_shallow' is set to the maximum allowed delay between
- * scrubs. This deadline has almost no effect on scrub scheduling
- * (the only minor exception: when sorting two scrub jobs that are
- * equivalent in all but the deadline). It will be removed in
- * the next version.
- *
- * 'max_shallow' is controlled by a pool option and a configuration
- * parameter. Note that if the value configured is less than the
- * shallow interval (plus expenses), the max_shallow is disabled.
- */
- auto max_shallow = pool_conf.value_or(pool_opts_t::SCRUB_MAX_INTERVAL, 0.0);
- if (max_shallow <= 0.0) {
- max_shallow = conf->osd_scrub_max_interval;
- }
-
- if (max_shallow > 0.0) {
- const auto min_accepted_deadline =
- configs.shallow_interval *
- (1 + conf->osd_scrub_interval_randomize_ratio);
-
- if (max_shallow >= min_accepted_deadline) {
- configs.max_shallow = max_shallow;
- } else {
- // this is a bit odd, but the pool option is set to a value
- // less than the interval. Keep the nullopt in max_shallow,
- dout(10) << fmt::format(
- "{}: configured 'max shallow' rejected as too low ({}/{} "
- "< {})",
- __func__,
- pool_conf.value_or(pool_opts_t::SCRUB_MAX_INTERVAL, 0.0),
- conf->osd_scrub_max_interval, min_accepted_deadline)
- << dendl;
- }
- }
-
configs.interval_randomize_ratio = conf->osd_scrub_interval_randomize_ratio;
configs.deep_randomize_ratio =
conf.get_val<double>("osd_deep_scrub_interval_cv");
std::max(current_targ.urgency(), aborted_target.urgency());
curr_sched.scheduled_at =
std::min(curr_sched.scheduled_at, abrt_sched.scheduled_at);
- curr_sched.deadline = std::min(curr_sched.deadline, abrt_sched.deadline);
curr_sched.not_before =
std::min(curr_sched.not_before, abrt_sched.not_before);
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;
// add a random delay to the proposed scheduled time
adj_target += app_conf.shallow_interval;
double r = rand() / (double)RAND_MAX;
adj_target +=
- app_conf.shallow_interval * app_conf.interval_randomize_ratio * r;
+ app_conf.shallow_interval * app_conf.interval_randomize_ratio * r;
- // the deadline can be updated directly into the scrub-job
- if (app_conf.max_shallow) {
- sh_times.deadline += *app_conf.max_shallow;
- } else {
- sh_times.deadline = utime_t::max();
- }
if (adj_not_before < adj_target) {
adj_not_before = adj_target;
}
} else {
- // the target time is already set. Make sure to reset the n.b. and
- // the (irrelevant) deadline
+ // the target time is already set. Make sure to reset the n.b.
sh_times.not_before = sh_times.scheduled_at;
- sh_times.deadline = utime_t::max();
}
dout(10) << fmt::format(
- "adjusted: nb:{:s} target:{:s} deadline:{:s} ({})",
- sh_times.not_before, sh_times.scheduled_at, sh_times.deadline,
- state_desc())
+ "adjusted: nb:{:s} target:{:s} ({})", sh_times.not_before,
+ sh_times.scheduled_at, state_desc())
<< dendl;
}
<< dendl;
auto& dp_times = deep_target.sched_info.schedule; // shorthand
- dp_times.deadline = utime_t::max(); // no 'max' for deep scrubs
if (ScrubJob::requires_randomization(deep_target.urgency())) {
utime_t adj_target = last_deep;
f->dump_stream("pgid") << pgid;
f->dump_stream("sched_time") << get_sched_time();
f->dump_stream("orig_sched_time") << sch.scheduled_at;
- f->dump_stream("deadline") << sch.deadline;
f->dump_bool("forced", entry.urgency >= urgency_t::operator_requested);
}
/// the desired interval between deep scrubs
double deep_interval{0.0};
- /**
- * the maximum interval between shallow scrubs, after which the
- * (info-only) "overdue" field in the scheduler dump is set.
- * Determined by either the pool or the cluster configuration.
- * Empty if no limit is configured.
- */
- std::optional<double> max_shallow;
-
/**
* interval_randomize_ratio
*
/**
* Given a proposed time for the next scrub, and the relevant
- * configuration, adjust_schedule() determines the actual target time,
- * the deadline, and the 'not_before' time for the scrub.
+ * configuration, adjust_schedule() determines the actual target time
+ * and the 'not_before' time for the scrub.
* The new values are updated into the scrub-job.
*
* Specifically:
* - for high-priority scrubs: the 'not_before' is set to the
* (untouched) proposed target time.
* - for regular scrubs: the proposed time is adjusted (delayed) based
- * on the configuration; the deadline is set further out (if configured)
- * and the n.b. is reset to the target.
+ * on the configuration; the n.b. is reset to the target.
*/
void adjust_shallow_schedule(
utime_t last_scrub,
{
return fmt::format_to(
ctx.out(),
- "periods:s:{}/{},d:{},iv-ratio:{},deep-rand:{},on-inv:{}",
- cf.shallow_interval, cf.max_shallow.value_or(-1.0), cf.deep_interval,
+ "periods:s:{},d:{},iv-ratio:{},deep-rand:{},on-inv:{}",
+ cf.shallow_interval, cf.deep_interval,
cf.interval_randomize_ratio, cf.deep_randomize_ratio,
cf.mandatory_on_invalid);
}
* a specific scrub level. Namely - it identifies the [pg,level] combination,
* the 'urgency' attribute of the scheduled scrub (which determines most of
* its behavior and scheduling decisions) and the actual time attributes
- * for scheduling (target, deadline, not_before).
+ * for scheduling (target time & not_before).
*/
struct SchedEntry {
constexpr SchedEntry(spg_t pgid, scrub_level_t level)
urgency_t urgency{urgency_t::periodic_regular};
- /// scheduled_at, not-before & the deadline times
+ /// scheduled_at and not-before times
Scrub::scrub_schedule_t schedule;
/// either 'none', or the reason for the latest failure/delay (for
auto format(const Scrub::SchedEntry& st, FormatContext& ctx) const
{
return fmt::format_to(
- ctx.out(), "{}/{},nb:{:s},({},tr:{:s},dl:{:s})", st.pgid,
+ ctx.out(), "{}/{},nb:{:s},({},tr:{:s})", st.pgid,
(st.level == scrub_level_t::deep ? "dp" : "sh"), st.schedule.not_before,
- st.urgency, st.schedule.scheduled_at, st.schedule.deadline);
+ st.urgency, st.schedule.scheduled_at);
}
};
} // namespace fmt
};
/// a collection of the basic scheduling information of a scrub target:
-/// target time to scrub, the 'not before' time, and a deadline.
+/// target time to scrub, and the 'not before'.
struct scrub_schedule_t {
/**
* the time at which we are allowed to start the scrub. Never
*/
utime_t not_before{utime_t::max()};
- /**
- * the 'deadline' is the time by which we expect the periodic scrub to
- * complete. It is determined by the SCRUB_MAX_INTERVAL pool configuration
- * and by osd_scrub_max_interval;
- * Note: the 'deadline' has only a limited effect on scheduling: when
- * comparing jobs having identical urgency and target time (scheduled_at'),
- * the job with the earlier 'deadline' is preferred.
- * Being past deadline also sets the 'overdue' flag in scrub
- * scheduling dumps.
- */
- utime_t deadline{utime_t::max()};
-
/**
* the 'scheduled_at' is the time at which we intended the scrub to be scheduled.
* For periodic (regular) scrubs, it is set to the time of the last scrub
{
// when compared - the 'not_before' is ignored, assuming
// we never compare jobs with different eligibility status.
- auto cmp1 = scheduled_at <=> rhs.scheduled_at;
- if (cmp1 != 0) {
- return cmp1;
- }
- return deadline <=> rhs.deadline;
+ return scheduled_at <=> rhs.scheduled_at;
};
+
bool operator==(const scrub_schedule_t& rhs) const = default;
};
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
- auto format(const Scrub::OSDRestrictions& conds, FormatContext& ctx) const
- {
+ auto format(const Scrub::OSDRestrictions& conds, FormatContext& ctx) const {
return fmt::format_to(
ctx.out(), "<{}.{}.{}.{}.{}>",
conds.max_concurrency_reached ? "max-scrubs" : "",
struct formatter<Scrub::scrub_schedule_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
- auto format(const Scrub::scrub_schedule_t& sc, FormatContext& ctx) const
- {
+ auto format(const Scrub::scrub_schedule_t& sc, FormatContext& ctx) const {
return fmt::format_to(
- ctx.out(), "nb:{:s}(at:{:s},dl:{:s})", sc.not_before,
- sc.scheduled_at, sc.deadline);
+ ctx.out(), "nb:{:s}(at:{:s})", sc.not_before, sc.scheduled_at);
}
};