Skip to content

Commit 071abe9

Browse files
committed
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 <[email protected]>
1 parent e11d6ce commit 071abe9

File tree

4 files changed

+6
-40
lines changed

4 files changed

+6
-40
lines changed

src/common/options/osd.yaml.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,6 @@ options:
211211
level: advanced
212212
desc: Asserts that no clone-objects were added to a snap after we start trimming it
213213
default: false
214-
- name: osd_repair_during_recovery
215-
type: bool
216-
level: advanced
217-
desc: Allow requested repairing when PGs on the OSD are undergoing recovery
218-
default: false
219-
with_legacy: true
220214
- name: osd_scrub_begin_hour
221215
type: int
222216
level: advanced

src/osd/scrubber/osd_scrub.cc

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,9 @@ Scrub::OSDRestrictions OsdScrub::restrictions_on_scrubbing(
201201
env_conditions.random_backoff_active = true;
202202

203203
} else if (is_recovery_active && !conf->osd_scrub_during_recovery) {
204-
if (conf->osd_repair_during_recovery) {
205-
dout(15)
206-
<< "will only schedule explicitly requested repair due to active "
207-
"recovery"
208-
<< dendl;
209-
env_conditions.allow_requested_repair_only = true;
210-
211-
} else {
212-
dout(15) << "recovery in progress. Operator-initiated scrubs only."
213-
<< dendl;
214-
env_conditions.recovery_in_progress = true;
215-
}
204+
dout(15) << "recovery in progress. Operator-initiated scrubs only."
205+
<< dendl;
206+
env_conditions.recovery_in_progress = true;
216207
} else {
217208

218209
// regular, i.e. non-high-priority scrubs are allowed

src/osd/scrubber/pg_scrubber.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,20 +2256,6 @@ Scrub::schedule_result_t PgScrubber::start_scrub_session(
22562256
}
22572257
}
22582258

2259-
// if only explicitly requested repairing is allowed - skip other types
2260-
// of scrubbing
2261-
if (osd_restrictions.allow_requested_repair_only &&
2262-
ScrubJob::observes_recovery(trgt.urgency())) {
2263-
dout(10) << __func__
2264-
<< ": skipping this PG as repairing was not explicitly "
2265-
"requested for it"
2266-
<< dendl;
2267-
requeue_penalized(
2268-
s_or_d, delay_both_targets_t::yes, delay_cause_t::scrub_params,
2269-
clock_now);
2270-
return schedule_result_t::target_specific_failure;
2271-
}
2272-
22732259
// try to reserve the local OSD resources. If failing: no harm. We will
22742260
// be retried by the OSD later on.
22752261
if (!reserve_local(trgt)) {

src/osd/scrubber_common.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,13 @@ struct OSDRestrictions {
8989
/// rolled a dice, and decided not to scrub in this tick
9090
bool random_backoff_active{false};
9191

92-
/// the OSD is performing recovery & osd_repair_during_recovery is 'true'
93-
bool allow_requested_repair_only:1{false};
94-
9592
/// the CPU load is high. No regular scrubs are allowed.
9693
bool cpu_overloaded:1{false};
9794

9895
/// outside of allowed scrubbing hours/days
9996
bool restricted_time:1{false};
10097

101-
/// the OSD is performing a recovery, osd_scrub_during_recovery is 'false',
102-
/// and so is osd_repair_during_recovery
98+
/// the OSD is performing a recovery & osd_scrub_during_recovery is 'false'
10399
bool recovery_in_progress:1{false};
104100
};
105101
static_assert(sizeof(Scrub::OSDRestrictions) <= sizeof(uint32_t));
@@ -193,13 +189,12 @@ struct formatter<Scrub::OSDRestrictions> {
193189
auto format(const Scrub::OSDRestrictions& conds, FormatContext& ctx) const
194190
{
195191
return fmt::format_to(
196-
ctx.out(), "<{}.{}.{}.{}.{}.{}>",
192+
ctx.out(), "<{}.{}.{}.{}.{}>",
197193
conds.max_concurrency_reached ? "max-scrubs" : "",
198194
conds.random_backoff_active ? "backoff" : "",
199195
conds.cpu_overloaded ? "high-load" : "",
200196
conds.restricted_time ? "time-restrict" : "",
201-
conds.recovery_in_progress ? "recovery" : "",
202-
conds.allow_requested_repair_only ? "repair-only" : "");
197+
conds.recovery_in_progress ? "recovery" : "");
203198
}
204199
};
205200

0 commit comments

Comments
 (0)