From: Ronen Friedman Date: Sun, 24 Nov 2024 14:27:38 +0000 (-0600) Subject: osd/scrub: remove config option osd_repair_during_recovery X-Git-Tag: testing/wip-pdonnell-testing-20250225.023119-debug~32^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=071abe955dfe4ebd8e1245808864444482c4ccdc;p=ceph-ci.git osd/scrub: remove config option osd_repair_during_recovery 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 --- diff --git a/src/common/options/osd.yaml.in b/src/common/options/osd.yaml.in index 2be1c08f934..d35b15473e9 100644 --- a/src/common/options/osd.yaml.in +++ b/src/common/options/osd.yaml.in @@ -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 diff --git a/src/osd/scrubber/osd_scrub.cc b/src/osd/scrubber/osd_scrub.cc index 0496584c3bb..f80cf04f3e1 100644 --- a/src/osd/scrubber/osd_scrub.cc +++ b/src/osd/scrubber/osd_scrub.cc @@ -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 diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index 73d742b9bd7..0a218098f88 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -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)) { diff --git a/src/osd/scrubber_common.h b/src/osd/scrubber_common.h index 2ab5570a715..14a09fc79db 100644 --- a/src/osd/scrubber_common.h +++ b/src/osd/scrubber_common.h @@ -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 { 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" : ""); } };