]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/scrub: remove flags_to_shallow_priority()
authorRonen Friedman <rfriedma@redhat.com>
Thu, 5 Sep 2024 06:06:36 +0000 (01:06 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 9 Sep 2024 06:43:42 +0000 (01:43 -0500)
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>
src/osd/PG.cc
src/osd/PG.h
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h

index f7a5033574f7672404561e8dc99ab3f3d12a868d..718d7d309ba396212555452cd1cdd35d553936b7 100644 (file)
@@ -1279,12 +1279,6 @@ void PG::requeue_map_waiters()
   }
 }
 
-bool PG::get_must_scrub() const
-{
-  dout(20) << __func__ << " must_scrub? " << (m_planned_scrub.must_scrub ? "true" : "false") << dendl;
-  return m_planned_scrub.must_scrub;
-}
-
 unsigned int PG::scrub_requeue_priority(Scrub::scrub_prio_t with_priority) const
 {
   return m_scrubber->scrub_requeue_priority(with_priority);
index 6bcb77ee5a9d18ea13cb69a2813a6c56f81f8e77..4947dcd27de5e2f7e0b8a7713dc4c2d5388d7fa8 100644 (file)
@@ -685,8 +685,6 @@ public:
   void shutdown();
   virtual void on_shutdown() = 0;
 
-  bool get_must_scrub() const;
-
   Scrub::schedule_result_t start_scrubbing(
     const Scrub::SchedEntry& candidate,
     Scrub::OSDRestrictions osd_restrictions);
index b0bdc9fcb9594318aad791ae79fcf379c5eb1aeb..97cdf49631a0a7eb97e92c327e17f28ab96bffae 100644 (file)
@@ -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:
index d751081566e9edf81b5c2631e16375777cf8968e..95da64825ecb8343087b571df0321476645478d1 100644 (file)
@@ -875,14 +875,6 @@ class PgScrubber : public ScrubPgIF,
       const Scrub::sched_conf_t& app_conf,
       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'