]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: remove 'calculated_to_deep' flag
authorRonen Friedman <rfriedma@redhat.com>
Mon, 29 Jul 2024 04:34:32 +0000 (23:34 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 25 Aug 2024 13:01:00 +0000 (08:01 -0500)
as once a sched-target was selected, we know the level of the scrub.
Also removed: the ephemeral 'time_for_deep' flag.

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

index 6c2dff17bd7be108606bec94354433381ef5a032..9530cff7d7a7815de89747fce0e497f8a6cbbed1 100644 (file)
@@ -73,8 +73,6 @@ ostream& operator<<(ostream& out, const requested_scrub_t& sf)
     out << " MUST_DEEP_SCRUB";
   if (sf.must_scrub)
     out << " MUST_SCRUB";
-  if (sf.time_for_deep)
-    out << " TIME_FOR_DEEP";
   if (sf.need_auto)
     out << " NEED_AUTO";
   if (sf.req_scrub)
@@ -1721,13 +1719,10 @@ void PgScrubber::set_op_parameters(const requested_scrub_t& request)
   state_set(PG_STATE_SCRUBBING);
 
   // will we be deep-scrubbing?
-  if (request.calculated_to_deep) {
+  m_is_deep = m_active_target->sched_info.level == scrub_level_t::deep;
+  if (m_is_deep) {
     state_set(PG_STATE_DEEP_SCRUB);
-    m_is_deep = true;
   } else {
-    m_is_deep = false;
-
-    // make sure we got the 'calculated_to_deep' flag right
     ceph_assert(!request.must_deep_scrub);
     ceph_assert(!request.need_auto);
   }
@@ -2353,8 +2348,8 @@ Scrub::schedule_result_t PgScrubber::start_scrub_session(
     return schedule_result_t::osd_wide_failure;
   }
 
-  // can commit to the updated flags now, as nothing will stop the scrub
-  //m_planned_scrub = *updated_flags;
+  // can commit now to the specific scrub details, as nothing will
+  // stop the scrub
 
   // An interrupted recovery repair could leave this set.
   state_clear(PG_STATE_REPAIR);
@@ -2385,7 +2380,7 @@ void PgScrubber::dump_scrubber(ceph::Formatter* f,
 {
   f->open_object_section("scrubber");
 
-  if (m_active) {  // TBD replace with PR#42780's test
+  if (m_active_target) {
     f->dump_bool("active", true);
     dump_active_scrubber(f, state_test(PG_STATE_DEEP_SCRUB));
   } else {
index 8e2e13c97a604787d48e5fc07a3dbeaf44ca9cef..12808f71e7f3ef50191d27f6a334274630fd74a5 100644 (file)
@@ -325,17 +325,6 @@ struct requested_scrub_t {
    */
   bool must_deep_scrub{false};
 
-  /**
-   * (An intermediary flag used by pg::sched_scrub() on the first time
-   * a planned scrub has all its resources). Determines whether the next
-   * repair/scrub will be 'deep'.
-   *
-   * Note: 'dumped' by PgScrubber::dump() and such. In reality, being a
-   * temporary that is set and reset by the same operation, will never
-   * appear externally to be set
-   */
-  bool time_for_deep{false};
-
   bool deep_scrub_on_error{false};
 
   /**
@@ -350,15 +339,9 @@ struct requested_scrub_t {
    * the value of auto_repair is determined in sched_scrub() (once per scrub.
    * previous value is not remembered). Set if
    * - allowed by configuration and backend, and
-   * - for periodic scrubs: time_for_deep was just set
+   * - for periodic scrubs: time_for_deep was just set RRR
    */
   bool auto_repair{false};
-
-  /**
-   * Used to indicate, both in client-facing listings and internally, that
-   * the planned scrub will be a deep one.
-   */
-  bool calculated_to_deep{false};
 };
 
 std::ostream& operator<<(std::ostream& out, const requested_scrub_t& sf);
@@ -371,16 +354,14 @@ struct fmt::formatter<requested_scrub_t> {
   auto format(const requested_scrub_t& rs, FormatContext& ctx)
   {
     return fmt::format_to(ctx.out(),
-                          "(plnd:{}{}{}{}{}{}{}{}{})",
+                          "(plnd:{}{}{}{}{}{}{})",
                           rs.must_repair ? " must_repair" : "",
                           rs.auto_repair ? " auto_repair" : "",
                           rs.deep_scrub_on_error ? " deep_scrub_on_error" : "",
                           rs.must_deep_scrub ? " must_deep_scrub" : "",
                           rs.must_scrub ? " must_scrub" : "",
-                          rs.time_for_deep ? " time_for_deep" : "",
                           rs.need_auto ? " need_auto" : "",
-                          rs.req_scrub ? " req_scrub" : "",
-                          rs.calculated_to_deep ? " deep" : "");
+                          rs.req_scrub ? " req_scrub" : "");
   }
 };