Feature #40955
Extend the scrub sleep time when the period is outside [osd_scrub_begin_hour, osd_scrub_end_hour)
0%
Description
We already have osd_scrub_begin_week_day, osd_scrub_end_week_day, osd_scrub_begin_hour and osd_scrub_end_hour to tell OSD what period is proper to schedule scrubbing.
However, some scrub may happen to be scheduled just a short time before osd_scrub_begin_hour and cannot complete before osd_scrub_begin_hour, thus crosses the boundary of [osd_scrub_begin_hour, osd_scrub_end_hour).
In order to mitigate such impact of the scrubs, we may add a new option osd_scrub_extended_sleep (default is 0) and the logic is as follows:
1. when scrub_time_permit() return true, the existing osd_scrub_sleep is used 2. when scrub_time_permit() return false, there may be 2 scenarios 2.1 if osd_scrub_extended_sleep <= osd_scrub_sleep, let's take osd_scrub_sleep 2.2 otherwise, let's take osd_scrub_extended_sleep
So we can set a relatively large value (such as 10) to osd_scrub_extended_sleep. Thus the scrubs across the boundary of [osd_scrub_begin_hour, osd_scrub_end_hour) may be suppressed and the impact on client IO will be mitigated.
History
#1 Updated by Jeegn Chen over 4 years ago
#2 Updated by Kefu Chai over 4 years ago
- Status changed from New to Fix Under Review
- Assignee set to Jeegn Chen
- Pull request ID set to 29342
#3 Updated by Jeegn Chen over 4 years ago
One more scenoario dzafman's comment:
@Jeegn-Chen Another way a scrub could happen even with scrub_time_permit() returns false would be when the scrub deadline is reached (scrub_max_interval). So a scrub could even start when it is not normally permitted if there hasn't been enough time to scrub even once during the scrub_min_interval due to load or time restrictions.
#4 Updated by Jeegn Chen over 4 years ago
Updated logic:
1. always take osd_scrub_sleep for manually initiated scrubs 2. when scrub_time_permit() return true for scheduled ones, the existing osd_scrub_sleep is used 3. when scrub_time_permit() return false for scheduled ones, there may be 2 scenarios 3.1 if osd_scrub_extended_sleep <= osd_scrub_sleep, let's take osd_scrub_sleep 3.2 otherwise, let's take osd_scrub_extended_sleep
#5 Updated by David Zafman over 4 years ago
- Status changed from Fix Under Review to Resolved