@@ -13,7 +13,6 @@ using OSDRestrictions = Scrub::OSDRestrictions;
1313using sched_conf_t = Scrub::sched_conf_t ;
1414using scrub_schedule_t = Scrub::scrub_schedule_t ;
1515using ScrubJob = Scrub::ScrubJob;
16- using delay_ready_t = Scrub::delay_ready_t ;
1716using namespace std ::chrono;
1817
1918using SchedEntry = Scrub::SchedEntry;
@@ -99,15 +98,11 @@ void ScrubJob::set_both_targets_queued()
9998void ScrubJob::adjust_shallow_schedule (
10099 utime_t last_scrub,
101100 const Scrub::sched_conf_t & app_conf,
102- utime_t scrub_clock_now,
103- delay_ready_t modify_ready_targets)
101+ utime_t scrub_clock_now)
104102{
105103 dout (10 ) << fmt::format (
106- " at entry: shallow target:{}, conf:{}, last-stamp:{:s} "
107- " also-ready?{:c}" ,
108- shallow_target, app_conf, last_scrub,
109- (modify_ready_targets == delay_ready_t ::delay_ready) ? ' y'
110- : ' n' )
104+ " at entry: shallow target:{}, conf:{}, last-stamp:{:s}" ,
105+ shallow_target, app_conf, last_scrub)
111106 << dendl;
112107
113108 auto & sh_times = shallow_target.sched_info .schedule ; // shorthand
@@ -117,15 +112,11 @@ void ScrubJob::adjust_shallow_schedule(
117112 utime_t adj_target = last_scrub;
118113 sh_times.deadline = adj_target;
119114
120- // add a random delay to the proposed scheduled time - but only for periodic
121- // scrubs that are not already eligible for scrubbing.
122- if ((modify_ready_targets == delay_ready_t ::delay_ready) ||
123- adj_not_before > scrub_clock_now) {
124- adj_target += app_conf.shallow_interval ;
125- double r = rand () / (double )RAND_MAX;
126- adj_target +=
115+ // add a random delay to the proposed scheduled time
116+ adj_target += app_conf.shallow_interval ;
117+ double r = rand () / (double )RAND_MAX;
118+ adj_target +=
127119 app_conf.shallow_interval * app_conf.interval_randomize_ratio * r;
128- }
129120
130121 // the deadline can be updated directly into the scrub-job
131122 if (app_conf.max_shallow ) {
@@ -238,15 +229,11 @@ utime_t ScrubJob::get_sched_time() const
238229void ScrubJob::adjust_deep_schedule (
239230 utime_t last_deep,
240231 const Scrub::sched_conf_t & app_conf,
241- utime_t scrub_clock_now,
242- delay_ready_t modify_ready_targets)
232+ utime_t scrub_clock_now)
243233{
244234 dout (10 ) << fmt::format (
245- " at entry: deep target:{}, conf:{}, last-stamp:{:s} "
246- " also-ready?{:c}" ,
247- deep_target, app_conf, last_deep,
248- (modify_ready_targets == delay_ready_t ::delay_ready) ? ' y'
249- : ' n' )
235+ " at entry: deep target:{}, conf:{}, last-stamp:{:s}" ,
236+ deep_target, app_conf, last_deep)
250237 << dendl;
251238
252239 auto & dp_times = deep_target.sched_info .schedule ; // shorthand
@@ -256,23 +243,19 @@ void ScrubJob::adjust_deep_schedule(
256243 utime_t adj_target = last_deep;
257244 dp_times.deadline = adj_target;
258245
259- // add a random delay to the proposed scheduled time - but only for periodic
260- // scrubs that are not already eligible for scrubbing.
261- if ((modify_ready_targets == delay_ready_t ::delay_ready) ||
262- adj_not_before > scrub_clock_now) {
263- double sdv = app_conf.deep_interval * app_conf.deep_randomize_ratio ;
264- std::normal_distribution<double > normal_dist{app_conf.deep_interval , sdv};
265- auto next_delay = std::clamp (
266- normal_dist (random_gen), app_conf.deep_interval - 2 * sdv,
267- app_conf.deep_interval + 2 * sdv);
268- adj_target += next_delay;
269- dout (20 ) << fmt::format (
270- " deep scrubbing: next_delay={:.0f} (interval={:.0f}, "
271- " ratio={:.3f}), adjusted:{:s}" ,
272- next_delay, app_conf.deep_interval ,
273- app_conf.deep_randomize_ratio , adj_target)
274- << dendl;
275- }
246+ // add a random delay to the proposed scheduled time
247+ const double sdv = app_conf.deep_interval * app_conf.deep_randomize_ratio ;
248+ std::normal_distribution<double > normal_dist{app_conf.deep_interval , sdv};
249+ auto next_delay =
250+ std::clamp (normal_dist (random_gen), app_conf.deep_interval - 2 * sdv,
251+ app_conf.deep_interval + 2 * sdv);
252+ adj_target += next_delay;
253+ dout (20 ) << fmt::format (
254+ " deep scrubbing: next_delay={:.0f} (interval={:.0f}, "
255+ " ratio={:.3f}), adjusted:{:s}" ,
256+ next_delay, app_conf.deep_interval ,
257+ app_conf.deep_randomize_ratio , adj_target)
258+ << dendl;
276259
277260 // the deadline can be updated directly into the scrub-job
278261 if (app_conf.max_shallow ) {
0 commit comments