Skip to content

Commit 54addff

Browse files
authored
Merge pull request ceph#63597 from ronen-fr/wip-rf-63559-tentacle
tentacle: osd/scrub: only periodic_regular scrubs should extended-sleep Reviewed-by: Radoslaw Zarzynski <[email protected]>
2 parents be7b05e + 26e061b commit 54addff

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

src/osd/scrubber/osd_scrub.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@ bool OsdScrub::scrub_time_permit(utime_t now) const
348348

349349

350350
std::chrono::milliseconds OsdScrub::scrub_sleep_time(
351-
utime_t t,
352-
bool high_priority_scrub) const
351+
utime_t t_now,
352+
bool scrub_respects_ext_sleep) const
353353
{
354354
const milliseconds regular_sleep_period =
355355
milliseconds{int64_t(std::max(0.0, 1'000 * conf->osd_scrub_sleep))};
356356

357-
if (high_priority_scrub || scrub_time_permit(t)) {
357+
if (!scrub_respects_ext_sleep || scrub_time_permit(t_now)) {
358358
return regular_sleep_period;
359359
}
360360

src/osd/scrubber/osd_scrub.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,16 @@ class OsdScrub {
104104
* chunks.
105105
*
106106
* Implementation Note: Returned value is either osd_scrub_sleep or
107-
* osd_scrub_extended_sleep, depending on must_scrub_param and time
108-
* of day (see configs osd_scrub_begin*)
107+
* osd_scrub_extended_sleep:
108+
* - if scrubs are allowed at this point in time - osd_scrub_sleep; otherwise
109+
* (i.e. - the current time is outside of the allowed scrubbing hours/days,
110+
* but the scrub started earlier):
111+
* - if the scrub observes "extended sleep" (i.e. - it's a low urgency
112+
* scrub) - osd_scrub_extended_sleep.
109113
*/
110114
std::chrono::milliseconds scrub_sleep_time(
111-
utime_t t,
112-
bool high_priority_scrub) const;
115+
utime_t t_now,
116+
bool scrub_respects_ext_sleep) const;
113117

114118

115119
/**

src/osd/scrubber/pg_scrubber.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2570,7 +2570,7 @@ std::chrono::milliseconds PgScrubber::get_scrub_sleep_time() const
25702570
{
25712571
return m_osds->get_scrub_services().scrub_sleep_time(
25722572
ceph_clock_now(),
2573-
!ScrubJob::observes_allowed_hours(m_active_target->urgency()));
2573+
ScrubJob::observes_extended_sleep(m_active_target->urgency()));
25742574
}
25752575

25762576
void PgScrubber::queue_for_scrub_resched(Scrub::scrub_prio_t prio)

src/osd/scrubber/scrub_job.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ bool ScrubJob::observes_allowed_hours(urgency_t urgency)
374374
return urgency < urgency_t::operator_requested;
375375
}
376376

377+
bool ScrubJob::observes_extended_sleep(urgency_t urgency)
378+
{
379+
return urgency == urgency_t::periodic_regular;
380+
}
381+
377382
bool ScrubJob::observes_load_limit(urgency_t urgency)
378383
{
379384
return urgency < urgency_t::after_repair;

src/osd/scrubber/scrub_job.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,14 @@ class ScrubJob {
336336
* | limitation | must- | after-repair |repairing| operator | must-repair |
337337
* | | scrub |(aft recovery)|(errors) | request | |
338338
* +------------+---------+--------------+---------+----------+-------------+
339-
* | reservation| yes! | no | no? + no | no |
340-
* | dow/time | yes | yes | no + no | no |
341-
* | ext-sleep | no | no | no + no | no |
342-
* | load | yes | no | no + no | no |
343-
* | noscrub | yes | no? | Yes + no | no |
344-
* | max-scrubs | yes | yes | Yes + no | no |
345-
* | backoff | yes | no | no + no | no |
346-
* | recovery | yes | yes | Yes + no | no |
339+
* | reservation| yes! | no | no? | no | no |
340+
* | dow/time | yes | yes | no | no | no |
341+
* | ext-sleep | no | no | no | no | no |
342+
* | load | yes | no | no | no | no |
343+
* | noscrub | yes | no | Yes | no | no |
344+
* | max-scrubs | yes | yes | Yes | no | no |
345+
* | backoff | yes | no | no | no | no |
346+
* | recovery | yes | yes | Yes | no | no |
347347
* +------------+---------+--------------+---------+----------+-------------+
348348
*/
349349

@@ -354,6 +354,8 @@ class ScrubJob {
354354

355355
static bool observes_allowed_hours(urgency_t urgency);
356356

357+
static bool observes_extended_sleep(urgency_t urgency);
358+
357359
static bool observes_load_limit(urgency_t urgency);
358360

359361
static bool requires_reservation(urgency_t urgency);

0 commit comments

Comments
 (0)