Skip to content

Commit f590506

Browse files
authored
Merge pull request ceph#63104 from ronen-fr/wip-rf-63093-tentacle
tentacle: osd/scrub: check all(*) conditions in restrictions_on_scrubbing() Reviewed-by: Nitzan Mordechai <[email protected]>
2 parents b74b612 + fcdb73e commit f590506

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

src/osd/scrubber/osd_scrub.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ Scrub::OSDRestrictions OsdScrub::restrictions_on_scrubbing(
189189
{
190190
Scrub::OSDRestrictions env_conditions;
191191

192-
// some environmental conditions prevent all but high priority scrubs
192+
// some "environmental conditions" prevent all but specific types
193+
// (urgency levels) of scrubs
193194

194195
if (!m_resource_bookkeeper.can_inc_scrubs()) {
195196
// our local OSD is already running too many scrubs
@@ -198,21 +199,20 @@ Scrub::OSDRestrictions OsdScrub::restrictions_on_scrubbing(
198199

199200
} else if (scrub_random_backoff()) {
200201
// dice-roll says we should not scrub now
201-
dout(15) << "Lost in dice. Only high priority scrubs allowed." << dendl;
202+
dout(15) << "Lost on the dice. Regular scheduled scrubs are not permitted."
203+
<< dendl;
202204
env_conditions.random_backoff_active = true;
205+
}
203206

204-
} else if (is_recovery_active && !conf->osd_scrub_during_recovery) {
207+
if (is_recovery_active && !conf->osd_scrub_during_recovery) {
205208
dout(15) << "recovery in progress. Operator-initiated scrubs only."
206209
<< dendl;
207210
env_conditions.recovery_in_progress = true;
208-
} else {
209-
210-
// regular, i.e. non-high-priority scrubs are allowed
211-
env_conditions.restricted_time = !scrub_time_permit(scrub_clock_now);
212-
env_conditions.cpu_overloaded =
213-
!m_load_tracker.scrub_load_below_threshold();
214211
}
215212

213+
env_conditions.restricted_time = !scrub_time_permit(scrub_clock_now);
214+
env_conditions.cpu_overloaded = !m_load_tracker.scrub_load_below_threshold();
215+
216216
return env_conditions;
217217
}
218218

src/osd/scrubber/osd_scrub.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,17 @@ class OsdScrub {
140140
/**
141141
* check the OSD-wide environment conditions (scrub resources, time, etc.).
142142
* These may restrict the type of scrubs we are allowed to start, maybe
143-
* down to allowing only high-priority scrubs
143+
* down to allowing only high-priority scrubs. See comments in scrub_job.h
144+
* detailing which condiitions may prevent what types of scrubs.
144145
*
145-
* Specifically:
146-
* 'only high priority' flag is set for either of
147-
* the following reasons: no local resources (too many scrubs on this OSD);
148-
* a dice roll says we will not scrub in this tick;
149-
* a recovery is in progress, and we are not allowed to scrub while recovery;
150-
* a PG is trying to acquire replica resources.
146+
* The following possible limiting conditions are checked:
147+
* - high local OSD concurrency (i.e. too many scrubs on this OSD);
148+
* - a "dice roll" says we will not scrub in this tick (note: this
149+
* specific condition is only checked if the "high concurrency" condition
150+
* above is not detected);
151+
* - the CPU load is high (i.e. above osd_scrub_cpu_load_threshold);
152+
* - the OSD is performing a recovery & osd_scrub_during_recovery is 'false';
153+
* - the current time is outside of the allowed scrubbing hours/days
151154
*/
152155
Scrub::OSDRestrictions restrictions_on_scrubbing(
153156
bool is_recovery_active,

0 commit comments

Comments
 (0)