summaryrefslogtreecommitdiffstats
path: root/src/osd/scrubber
diff options
context:
space:
mode:
authorRonen Friedman <rfriedma@redhat.com>2024-09-05 08:06:36 +0200
committerRonen Friedman <rfriedma@redhat.com>2024-09-09 08:43:42 +0200
commit22bb6d9ed558ded532c1604d311b8a3f128b047b (patch)
treece21582ea2dcfb840774a36bbdc95a3298361631 /src/osd/scrubber
parentMerge pull request #59642 from zdover23/wip-doc-2024-09-06-cephadm-upgrade (diff)
downloadceph-22bb6d9ed558ded532c1604d311b8a3f128b047b.tar.xz
ceph-22bb6d9ed558ded532c1604d311b8a3f128b047b.zip
osd/scrub: remove flags_to_shallow_priority()
As part of the removal of the 'planned scrub' flags (initiated in the previous PRs): flags_to..() is called from PgScrubber::update_targets(), and checks for two special cases before calling adjust_shallow_schedule(): 1) if the scrub is mandatory due to stats_invalid: the code to handle this case is moved to PgScrubber::update_targets(). 2) if the scrub is mandatory due to operator request: this is already handled by operator_forced_targets(). Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
Diffstat (limited to 'src/osd/scrubber')
-rw-r--r--src/osd/scrubber/pg_scrubber.cc29
-rw-r--r--src/osd/scrubber/pg_scrubber.h8
2 files changed, 6 insertions, 31 deletions
diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc
index b0bdc9fcb95..97cdf49631a 100644
--- a/src/osd/scrubber/pg_scrubber.cc
+++ b/src/osd/scrubber/pg_scrubber.cc
@@ -508,26 +508,6 @@ bool PgScrubber::flags_to_deep_priority(
}
-void PgScrubber::flags_to_shallow_priority(
- const Scrub::sched_conf_t& app_conf,
- utime_t scrub_clock_now)
-{
- auto& entry = m_scrub_job->shallow_target.sched_info_ref();
-
- if (m_planned_scrub.must_scrub) {
-
- // Set the smallest time that isn't utime_t()
- entry.schedule.scheduled_at = PgScrubber::scrub_must_stamp();
- ///\todo missing a distinct urgency level for 'must' scrubs
- entry.urgency = urgency_t::operator_requested;
-
- } else if (m_pg->info.stats.stats_invalid && app_conf.mandatory_on_invalid) {
- entry.schedule.scheduled_at = scrub_clock_now;
- entry.urgency = urgency_t::operator_requested;
- }
-}
-
-
void PgScrubber::update_targets(
const requested_scrub_t& planned,
utime_t scrub_clock_now)
@@ -543,9 +523,12 @@ void PgScrubber::update_targets(
// first, use the planned-scrub flags to possibly set one of the
// targets as high-priority.
// Note - this step is to be removed in the followup commits.
- auto deep_hp_set = flags_to_deep_priority(applicable_conf, scrub_clock_now);
- if (!deep_hp_set) {
- flags_to_shallow_priority(populate_config_params(), scrub_clock_now);
+ flags_to_deep_priority(applicable_conf, scrub_clock_now);
+
+ if (m_pg->info.stats.stats_invalid && applicable_conf.mandatory_on_invalid) {
+ m_scrub_job->shallow_target.sched_info_ref().schedule.scheduled_at =
+ scrub_clock_now;
+ m_scrub_job->shallow_target.up_urgency_to(urgency_t::must_scrub);
}
// the next periodic scrubs:
diff --git a/src/osd/scrubber/pg_scrubber.h b/src/osd/scrubber/pg_scrubber.h
index d751081566e..95da64825ec 100644
--- a/src/osd/scrubber/pg_scrubber.h
+++ b/src/osd/scrubber/pg_scrubber.h
@@ -876,14 +876,6 @@ class PgScrubber : public ScrubPgIF,
utime_t scrub_clock_now);
/**
- * use the 'planned scrub' flags to determine the urgency attribute
- * of the 'shallow target' part of the ScrubJob object.
- */
- void flags_to_shallow_priority(
- const Scrub::sched_conf_t& app_conf,
- utime_t scrub_clock_now);
-
- /**
* recompute the two ScrubJob targets, taking into account not
* only the up-to-date 'last' stamps, but also the 'planned scrub'
* flags.