]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: remove config option osd_repair_during_recovery
authorRonen Friedman <rfriedma@redhat.com>
Sun, 24 Nov 2024 14:27:38 +0000 (08:27 -0600)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 20 Feb 2025 08:17:33 +0000 (02:17 -0600)
The option was used to allow repair to be explicitly ordered by the
operator, even if the Primary OSD was in the middle of a recovery.
This is no longer necessary, as the code now accepts both repair and
scrub operator requests, even during recovery.

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

index 2be1c08f934c82d163d2313e2cae94e7c4382537..d35b15473e9c54a8f0e3a48e33239f6463d55176 100644 (file)
@@ -211,12 +211,6 @@ options:
   level: advanced
   desc: Asserts that no clone-objects were added to a snap after we start trimming it
   default: false
-- name: osd_repair_during_recovery
-  type: bool
-  level: advanced
-  desc: Allow requested repairing when PGs on the OSD are undergoing recovery
-  default: false
-  with_legacy: true
 - name: osd_scrub_begin_hour
   type: int
   level: advanced
index 0496584c3bb7f658159937eaffdac1bd28471fd2..f80cf04f3e1c4daf4c1b4957e7d42a0deab51370 100644 (file)
@@ -201,18 +201,9 @@ Scrub::OSDRestrictions OsdScrub::restrictions_on_scrubbing(
     env_conditions.random_backoff_active = true;
 
   } else if (is_recovery_active && !conf->osd_scrub_during_recovery) {
-    if (conf->osd_repair_during_recovery) {
-      dout(15)
-         << "will only schedule explicitly requested repair due to active "
-            "recovery"
-         << dendl;
-      env_conditions.allow_requested_repair_only = true;
-
-    } else {
-      dout(15) << "recovery in progress. Operator-initiated scrubs only."
-              << dendl;
-      env_conditions.recovery_in_progress = true;
-    }
+    dout(15) << "recovery in progress. Operator-initiated scrubs only."
+            << dendl;
+    env_conditions.recovery_in_progress = true;
   } else {
 
     // regular, i.e. non-high-priority scrubs are allowed
index 73d742b9bd7c252c097178dca9b97965aef65834..0a218098f888522c40f3cb226fd82d0a786614d1 100644 (file)
@@ -2256,20 +2256,6 @@ Scrub::schedule_result_t PgScrubber::start_scrub_session(
     }
   }
 
-  // if only explicitly requested repairing is allowed - skip other types
-  // of scrubbing
-  if (osd_restrictions.allow_requested_repair_only &&
-      ScrubJob::observes_recovery(trgt.urgency())) {
-    dout(10) << __func__
-            << ": skipping this PG as repairing was not explicitly "
-               "requested for it"
-            << dendl;
-    requeue_penalized(
-       s_or_d, delay_both_targets_t::yes, delay_cause_t::scrub_params,
-       clock_now);
-    return schedule_result_t::target_specific_failure;
-  }
-
   // try to reserve the local OSD resources. If failing: no harm. We will
   // be retried by the OSD later on.
   if (!reserve_local(trgt)) {
index 2ab5570a71519f4f475e751d6393a940a9b2c265..14a09fc79db6ed36ffab80c2bc4f6bc79c56effa 100644 (file)
@@ -89,17 +89,13 @@ struct OSDRestrictions {
   /// rolled a dice, and decided not to scrub in this tick
   bool random_backoff_active{false};
 
-  /// the OSD is performing recovery & osd_repair_during_recovery is 'true'
-  bool allow_requested_repair_only:1{false};
-
   /// the CPU load is high. No regular scrubs are allowed.
   bool cpu_overloaded:1{false};
 
   /// outside of allowed scrubbing hours/days
   bool restricted_time:1{false};
 
-  /// the OSD is performing a recovery, osd_scrub_during_recovery is 'false',
-  /// and so is osd_repair_during_recovery
+  /// the OSD is performing a recovery & osd_scrub_during_recovery is 'false'
   bool recovery_in_progress:1{false};
 };
 static_assert(sizeof(Scrub::OSDRestrictions) <= sizeof(uint32_t));
@@ -193,13 +189,12 @@ struct formatter<Scrub::OSDRestrictions> {
   auto format(const Scrub::OSDRestrictions& conds, FormatContext& ctx) const
   {
     return fmt::format_to(
-       ctx.out(), "<{}.{}.{}.{}.{}.{}>",
+       ctx.out(), "<{}.{}.{}.{}.{}>",
        conds.max_concurrency_reached ? "max-scrubs" : "",
        conds.random_backoff_active ? "backoff" : "",
        conds.cpu_overloaded ? "high-load" : "",
        conds.restricted_time ? "time-restrict" : "",
-       conds.recovery_in_progress ? "recovery" : "",
-       conds.allow_requested_repair_only ? "repair-only" : "");
+       conds.recovery_in_progress ? "recovery" : "");
   }
 };