]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/scrub: remove requested_scrub_t::need_auto
authorRonen Friedman <rfriedma@redhat.com>
Tue, 10 Sep 2024 06:43:28 +0000 (01:43 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 10 Sep 2024 06:43:28 +0000 (01:43 -0500)
as part of the ongoing work to remove the 'planned scrub'
flag set.

flags_to_deep_priority() is no longer needed, and
can be removed.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber_common.h

index 163641d92aa11870fe334db29dda5e69ef0beed6..38cf4531135286d6b62e8dec80fbb2f9f9ea1b78 100644 (file)
@@ -469,48 +469,15 @@ void PgScrubber::rm_from_osd_scrubbing()
 }
 
 
-bool PgScrubber::flags_to_deep_priority(
-    const Scrub::sched_conf_t& app_conf,
-    utime_t scrub_clock_now)
-{
-  auto& targ = m_scrub_job->deep_target;
-  auto& entry = m_scrub_job->deep_target.sched_info_ref();
-
-  // note: as we depend on the returned value to distinguish between existing h.p.
-  // and an instance in which that is set here, there is the added "not already
-  // high-priority" condition.
-  if (targ.urgency() >= urgency_t::operator_requested) {
-    return false;
-  }
-
-  if (m_planned_scrub.need_auto) {
-    // Set the smallest time that isn't utime_t()
-    entry.schedule.scheduled_at = PgScrubber::scrub_must_stamp();
-    entry.urgency = urgency_t::operator_requested;
-    return true;
-  }
-
-  return false; // not set to high-priority *by this function*
-}
-
-
-void PgScrubber::update_targets(
-    const requested_scrub_t& planned,
-    utime_t scrub_clock_now)
+void PgScrubber::update_targets(utime_t scrub_clock_now)
 {
   const auto applicable_conf = populate_config_params();
 
   dout(10) << fmt::format(
-                 "{}: config:{} flags:<{}> job on entry:{}{}", __func__,
-                 applicable_conf, planned, *m_scrub_job,
+                 "{}: config:{} job on entry:{}{}", __func__, applicable_conf,
+                 *m_scrub_job,
                  m_pg->info.stats.stats_invalid ? " invalid-stats" : "")
           << dendl;
-
-  // 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.
-  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;
@@ -572,9 +539,7 @@ void PgScrubber::update_scrub_job(Scrub::delay_ready_t delay_ready)
     return;
   }
 
-  dout(15) << fmt::format(
-                 "{}: flags:<{}> job on entry:{}", __func__, m_planned_scrub,
-                 *m_scrub_job)
+  dout(15) << fmt::format("{}: job on entry:{}", __func__, *m_scrub_job)
           << dendl;
 
   // if we were marked as 'not registered' - do not try to push into
@@ -594,14 +559,11 @@ void PgScrubber::update_scrub_job(Scrub::delay_ready_t delay_ready)
             << dendl;
   }
 
-  const auto scrub_clock_now = ceph_clock_now();
-  update_targets(m_planned_scrub, scrub_clock_now);
+  update_targets(ceph_clock_now());
   m_osds->get_scrub_services().enqueue_scrub_job(*m_scrub_job);
   m_scrub_job->set_both_targets_queued();
   m_pg->publish_stats_to_osd();
-  dout(10) << fmt::format(
-                 "{}: flags:<{}> job on exit:{}", __func__, m_planned_scrub,
-                 *m_scrub_job)
+  dout(10) << fmt::format("{}: job on exit:{}", __func__, *m_scrub_job)
           << dendl;
 }
 
@@ -637,7 +599,6 @@ scrub_level_t PgScrubber::scrub_requested(
 
   // modifying the planned-scrub flags - to be removed shortly
   // User might intervene, so clear this
-  req_flags.need_auto = false;
   req_flags.req_scrub = true;
   dout(20) << fmt::format("{}: planned scrub:{}", __func__, req_flags) << dendl;
 
@@ -2424,7 +2385,6 @@ void PgScrubber::dump_scrubber(
     // the following data item is deprecated. Will be replaced by a set
     // of reported attributes that match the updated scrub-job state.
     f->dump_bool("must_repair", earliest.urgency() == urgency_t::must_repair);
-    f->dump_bool("need_auto", request_flags.need_auto);
 
     f->dump_stream("scrub_reg_stamp")
        << earliest.sched_info.schedule.not_before;
index b1aecf19d92c69e5373e7300913b2a3d171b3d31..f2bbf1f0e8855035fe34891936883b216dda3407 100644 (file)
@@ -842,30 +842,12 @@ class PgScrubber : public ScrubPgIF,
    */
   Scrub::sched_conf_t populate_config_params() const;
 
-  /**
-   * use the 'planned scrub' flags to determine the urgency attribute
-   * of the 'deep target' part of the ScrubJob object.
-   *
-   * Returns 'true' if a high-priority 'urgency' level was set by this
-   * call (note: not if it was already set).
-   *
-   * Note: in the previous implementation, if the shallow scrub had
-   * high priority, and it was time for the periodic deep scrub, a
-   * high priority deep scrub was initiated. This behavior is not
-   * replicated here.
-   */
-  bool flags_to_deep_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.
+   * only the up-to-date 'last' stamps, but also the 'urgency'
+   * attributes of both targets.
    */
-  void update_targets(
-      const requested_scrub_t& planned,
-      utime_t scrub_clock_now);
+  void update_targets(utime_t scrub_clock_now);
 
   /*
    * Select a range of objects to scrub.
index 44bc5b8b752154a9e211510d1d94f2120225d8ea..2f476585116506642642732c5a9d5a5af18dfd95 100644 (file)
@@ -307,16 +307,6 @@ struct requested_scrub_t {
    * Will be copied into the 'required' scrub flag upon scrub start.
    */
   bool req_scrub{false};
-
-  /**
-   * Set from:
-   *  - scrub_requested() with need_auto param set, which only happens in
-   *  - scrub_finish() - if can_autorepair is set, and we have errors
-   *
-   * If set, will prevent the OSD from casually postponing our scrub. When
-   * scrubbing starts, will cause auto_repair to be set.
-   */
-  bool need_auto{false};
 };
 
 std::ostream& operator<<(std::ostream& out, const requested_scrub_t& sf);
@@ -329,8 +319,7 @@ struct fmt::formatter<requested_scrub_t> {
   auto format(const requested_scrub_t& rs, FormatContext& ctx) const
   {
     return fmt::format_to(ctx.out(),
-                          "(plnd:{}{})",
-                          rs.need_auto ? " need_auto" : "",
+                          "(plnd:{})",
                           rs.req_scrub ? " req_scrub" : "");
   }
 };