Skip to content

Commit 8cb3ddc

Browse files
authored
Merge pull request ceph#60357 from ronen-fr/wip-rf-transitive
osd/scrub: make sched-targets comparator transitive Reviewed-by: Samuel Just <[email protected]>
2 parents ed58632 + 16c23e0 commit 8cb3ddc

File tree

5 files changed

+15
-34
lines changed

5 files changed

+15
-34
lines changed

src/common/options/osd.yaml.in

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,8 @@ options:
212212
long_desc: Use osd_scrub_begin_hour=0 and osd_scrub_end_hour=0 for the entire day.
213213
fmt_desc: This restricts scrubbing to this hour of the day or later.
214214
Use ``osd_scrub_begin_hour = 0`` and ``osd_scrub_end_hour = 0``
215-
to allow scrubbing the entire day. Along with ``osd_scrub_end_hour``, they define a time
216-
window, in which the scrubs can happen.
217-
But a scrub will be performed
218-
no matter whether the time window allows or not, as long as the placement
219-
group's scrub interval exceeds ``osd_scrub_max_interval``.
215+
to allow scrubbing the entire day. Along with ``osd_scrub_end_hour`` they define a time
216+
window, only in which will periodic scrubs be initiated.
220217
default: 0
221218
see_also:
222219
- osd_scrub_end_hour
@@ -228,12 +225,10 @@ options:
228225
level: advanced
229226
desc: Restrict scrubbing to hours of the day earlier than this
230227
long_desc: Use osd_scrub_begin_hour=0 and osd_scrub_end_hour=0 for the entire day.
231-
fmt_desc: This restricts scrubbing to the hour earlier than this.
228+
fmt_desc: This restricts scrubbing to the hours earlier than this.
232229
Use ``osd_scrub_begin_hour = 0`` and ``osd_scrub_end_hour = 0`` to allow scrubbing
233230
for the entire day. Along with ``osd_scrub_begin_hour``, they define a time
234-
window, in which the scrubs can happen. But a scrub will be performed
235-
no matter whether the time window allows or not, as long as the placement
236-
group's scrub interval exceeds ``osd_scrub_max_interval``.
231+
window, only in which can periodic scrubs be automatically initiated.
237232
default: 0
238233
see_also:
239234
- osd_scrub_begin_hour
@@ -250,9 +245,7 @@ options:
250245
0 = Sunday, 1 = Monday, etc. Use ``osd_scrub_begin_week_day = 0``
251246
and ``osd_scrub_end_week_day = 0`` to allow scrubbing for the entire week.
252247
Along with ``osd_scrub_end_week_day``, they define a time window in which
253-
scrubs can happen. But a scrub will be performed
254-
no matter whether the time window allows or not, when the PG's
255-
scrub interval exceeds ``osd_scrub_max_interval``.
248+
periodic scrubs can be automatically initiated.
256249
default: 0
257250
see_also:
258251
- osd_scrub_end_week_day
@@ -269,9 +262,7 @@ options:
269262
0 = Sunday, 1 = Monday, etc. Use ``osd_scrub_begin_week_day = 0``
270263
and ``osd_scrub_end_week_day = 0`` to allow scrubbing for the entire week.
271264
Along with ``osd_scrub_begin_week_day``, they define a time
272-
window, in which the scrubs can happen. But a scrub will be performed
273-
no matter whether the time window allows or not, as long as the placement
274-
group's scrub interval exceeds ``osd_scrub_max_interval``.
265+
window, in which periodic scrubs can be automatically initiated.
275266
default: 0
276267
see_also:
277268
- osd_scrub_begin_week_day
@@ -282,8 +273,9 @@ options:
282273
type: float
283274
level: advanced
284275
desc: Allow scrubbing when system load divided by number of CPUs is below this value
285-
fmt_desc: The normalized maximum load. Ceph will not scrub when the system load
286-
(as defined by ``getloadavg() / number of online CPUs``) is higher than this number.
276+
fmt_desc: The normalized maximum load. Ceph will not initiate periodic (regular)
277+
scrubs when the system load (as defined by ``getloadavg() / number of online CPUs``)
278+
is higher than this number.
287279
Default is ``0.5``.
288280
default: 0.5
289281
with_legacy: true
@@ -292,8 +284,7 @@ options:
292284
type: float
293285
level: advanced
294286
desc: The desired interval between scrubs of a specific PG.
295-
fmt_desc: The desired interval in seconds between scrubs of a specific PG
296-
when the Ceph Storage Cluster load is low.
287+
fmt_desc: The desired interval in seconds between scrubs of a specific PG.
297288
default: 1_day
298289
see_also:
299290
- osd_scrub_max_interval
@@ -303,8 +294,7 @@ options:
303294
type: float
304295
level: advanced
305296
desc: Scrub each PG no less often than this interval
306-
fmt_desc: The maximum interval in seconds for scrubbing the Ceph OSD Daemon
307-
irrespective of cluster load.
297+
fmt_desc: The maximum interval in seconds for scrubbing each PG.
308298
default: 7_day
309299
see_also:
310300
- osd_scrub_min_interval
@@ -315,7 +305,7 @@ options:
315305
level: advanced
316306
desc: Ratio of scrub interval to randomly vary
317307
long_desc: This prevents a scrub 'stampede' by randomly varying the scrub intervals
318-
so that they are soon uniformly distributed over the week
308+
so that they are uniformly distributed over time.
319309
fmt_desc: Add a random delay to ``osd_scrub_min_interval`` when scheduling
320310
the next scrub job for a PG. The delay is a random
321311
value less than ``osd_scrub_min_interval`` \*

src/osd/scrubber/osd_scrub.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ Scrub::OSDRestrictions OsdScrub::restrictions_on_scrubbing(
220220
env_conditions.restricted_time = !scrub_time_permit(scrub_clock_now);
221221
env_conditions.cpu_overloaded =
222222
!m_load_tracker.scrub_load_below_threshold();
223-
env_conditions.only_deadlined =
224-
env_conditions.restricted_time || env_conditions.cpu_overloaded;
225223
}
226224

227225
return env_conditions;

src/osd/scrubber/osd_scrub_sched.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ std::optional<Scrub::SchedEntry> ScrubQueue::pop_ready_entry(
8686
OSDRestrictions restrictions,
8787
utime_t time_now)
8888
{
89-
/// \todo must handle 'only_deadlined'!
90-
9189
auto eligible_filtr = [&, rst = restrictions](
9290
const SchedEntry& e) -> bool {
9391
return eligibility_pred(e, rst, time_now);

src/osd/scrubber/scrub_queue_entry.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ static inline std::weak_ordering cmp_ripe_entries(
9898
if (auto cmp = r.urgency <=> l.urgency; cmp != 0) {
9999
return cmp;
100100
}
101-
// if we are comparing the two targets of the same PG, once both are
102-
// ripe - the 'deep' scrub is considered 'higher' than the 'shallow' one.
103-
if (l.pgid == r.pgid && r.level < l.level) {
104-
return std::weak_ordering::less;
105-
}
106101
// the 'utime_t' operator<=> is 'partial_ordering', it seems.
107102
if (auto cmp = std::weak_order(
108103
double(l.schedule.scheduled_at), double(r.schedule.scheduled_at));

src/osd/scrubber_common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ struct OSDRestrictions {
9292
/// the OSD is performing recovery & osd_repair_during_recovery is 'true'
9393
bool allow_requested_repair_only:1{false};
9494

95-
/// the load is high, or the time is not right. For periodic scrubs,
96-
/// only the overdue ones are allowed.
97-
bool only_deadlined:1{false};
95+
/// the CPU load is high. No regular scrubs are allowed.
9896
bool cpu_overloaded:1{false};
97+
98+
/// outside of allowed scrubbing hours/days
9999
bool restricted_time:1{false};
100100

101101
/// the OSD is performing a recovery, osd_scrub_during_recovery is 'false',

0 commit comments

Comments
 (0)