Repository navigation
Randomize scrub time - #3946
Randomize scrub time#3946
Conversation
|
@tchaikov , if time_permit and load_is_low are both false forever, ceph will not scrub based on this patch. Or time_permit is true and load_is_low is false, ceph will do scrub. I think this is not so reasonble |
|
SUCCESS: the output of run-make-check.sh on centos-7 for c537036cbb04abf6a6ef9bd20a007781a197eef8 is http://paste2.org/skA6ycmg |
|
@XinzeChi yeah, i agree. maybe we should force the scrub when |
in a high-load system, to avoid the scrub wave which worsen the system performance a lot, and to distribute the scrub jobs randomly. i think we should go this way, in other words, do not respect the load_is_low in some cases. |
|
Now, ceph would have several time to check if it is permitted(time or load) to do scrub. Ceph just force to do scrub if interval of scrub large than osd_scrub_max_interval. |
|
@XinzeChi yes, i see. we are attacking the problem of scrub scheduling from different angles, and i am trying to address the issue of http://tracker.ceph.com/issues/10973. |
|
@tchaikov, What about (pg->scrubber.must_scrub || (time_permit && (load_is_low || (!load_is_low && (double)diff >= cct->_conf->osd_scrub_max_interval))) ? |
|
@XinzeChi thank you, so put it in another way: will update the PR with you suggestion! |
026e63a to
e0e4eee
Compare
|
SUCCESS: the output of run-make-check.sh on centos-7 for 2fe33e24a3c22a0538bc9095b343f467b915b7c8 is http://paste2.org/FsyEchpe |
|
SUCCESS: the output of run-make-check.sh on centos-7 for 61723ff6f8440fdfd56eb2787daf6d1826b634cc is http://paste2.org/4k5WPVY7 |
There was a problem hiding this comment.
The scrubber.scrub_reg_stamp represents the last scrub (finishing) time for this PG, and will impact when the PG will be scheduled to scrub next time. With this implementation, it seems the scrubbing for next round will at least be postpone g_conf->osd_scrub_min_interval, and could be up to g_conf->osd_scrub_max_interval.
Does it make sense to just add a randomize value that is less than 1 hour (or make it configurable but default 1 hour) so that to respect the frequency of scrubbing as before?
|
@guangyy the idea of having the (min_interval, max_interval) delay is
|
|
@tchaikov , ah yeah, the way to check the diff is also changed, so the problem I explain is not an actual problem.. |
|
Oh, sorry, I meant that it should be distributed on [osd_scrub_min_interval, osd_scrub_min_interval + osd_scrub_randomization_interval). |
e0e4eee to
1340c41
Compare
1340c41 to
71ff3a3
Compare
|
@athanatos comments addressed. added a commit: tchaikov@71ff3a3 |
|
@tchaikov please ignore the false negative from the bot caused by a network failure. you can re-schedule by git commit --amend + git push force to change the hash of the topmost commit. |
71ff3a3 to
0c9995b
Compare
There was a problem hiding this comment.
this is no longer quite right, probably delay >= (osd_scrub_max_interval - osd_scrub_min_interval) or include the max_scrub scheduling time explicitely in the queue?
0c9995b to
0780b14
Compare
|
@tchaikov Passed testing. We should change the config option to be a fractoin of the scrub interval, though, so that (for example) existing clsuters with customized scrub intervals in ceph.conf don't ned up with a nonsensical randomization interval with this change (e.g., 1 day +/- 3 days, or three months +/- 3 days) |
|
thanks @liewegas . i see your point here, you are expecting a schedule time uniformly distributed over osd_scrub_min_interval +/- f * osd_scrub_min_interval, i.e. but IMHO, existing clusters with customized scrub intervals doe not end up with nonsensical randomised interval with this change, cause the schedule time will be i am good either way. the later is more consistent with other scrub interval settings as it's using seconds like the osd_scrub_{min,max}_interval. but it is not as user friendly as a fraction notation (of osd_scrub_min_interval). because 3 days~1.3_3days, or 3 months ~ 1.3_3months is easier for clusters with customized schedule intervals. will prepare another patch to replace "osd_scrub_randomization_interval" with "osd_scrub_interval_limit" (or a better name =). |
987eea5 to
c44cbb0
Compare
|
@liewegas could you take a look again? i updated this pull request to address your comments. thanks. |
df625e2 to
17eae76
Compare
a67236a to
ad0f02b
Compare
|
The version I tested (ad0f02b) passed tests. |
|
Also, looks good to me (I agree with osd_scrub_interval_randomize_ratio). |
avoid unnecessary comparison Signed-off-by: Kefu Chai <[email protected]>
Signed-off-by: Kefu Chai <[email protected]>
- to avoid the scrub wave when the osd_scrub_max_interval reaches in a
high-load OSD, the scrub time is randomized.
- extract scrub_load_below_threshold() out of scrub_should_schedule()
- schedule an automatic scrub job at a time which is uniformly distributed
over [now+osd_scrub_min_interval,
now+osd_scrub_min_interval*(1+osd_scrub_time_limit]. before
this change this sort of scrubs will be performed once the hard interval
is end or system load is below the threshold, but with this change, the
jobs will be performed as long as the load is low or the interval of
the scheduled scrubs is longer than conf.osd_scrub_max_interval. all
automatic jobs should be performed in the configured time period, otherwise
they are postponed.
- the requested scrub job will be scheduled right away, before this change
it is queued with the timestamp of `now` and postponed after
osd_scrub_min_interval.
Fixes: ceph#10973
Signed-off-by: Kefu Chai <[email protected]>
s/osd_scrub_interval_limit/osd_scrub_interval_randomize_ratio/ Fixes: ceph#10973 Signed-off-by: Kefu Chai <[email protected]>
ad0f02b to
6344fc8
Compare
|
@liewegas and @athanatos , thanks for the review and testing! will merge once the build bot confirms the build. |
osd: Randomize scrub time Reviewed-by: Sage Weil <[email protected]> Reviewed-by: Samuel Just <[email protected]>
No description provided.