Skip to content

Randomize scrub time - #3946

Merged
tchaikov merged 4 commits into
ceph:masterfrom
tchaikov:randomize-scrub-time
May 20, 2015
Merged

tchaikov merged 4 commits into
ceph:masterfrom
tchaikov:randomize-scrub-time

Conversation

@tchaikov

Copy link
Copy Markdown
Contributor

No description provided.

@XinzeChi

Copy link
Copy Markdown
Contributor

@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

@loic-bot

Copy link
Copy Markdown

SUCCESS: the output of run-make-check.sh on centos-7 for c537036cbb04abf6a6ef9bd20a007781a197eef8 is http://paste2.org/skA6ycmg

:octocat: Sent from GH.

@tchaikov

Copy link
Copy Markdown
Contributor Author

@XinzeChi yeah, i agree. maybe we should force the scrub when now - t >= cct->_conf->osd_scrub_max_interval . and after a second thought, i guess, if time_permit is always false, that's the user's choice, maybe we should respect it instead?

@tchaikov

Copy link
Copy Markdown
Contributor Author

Or time_permit is true and load_is_low is false, ceph will do scrub. I think this is not so reasonble

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.

@XinzeChi

Copy link
Copy Markdown
Contributor

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.

@tchaikov

Copy link
Copy Markdown
Contributor Author

@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.

@XinzeChi

Copy link
Copy Markdown
Contributor

@tchaikov, What about (pg->scrubber.must_scrub || (time_permit && (load_is_low || (!load_is_low && (double)diff >= cct->_conf->osd_scrub_max_interval))) ?

@tchaikov

Copy link
Copy Markdown
Contributor Author

@XinzeChi thank you, so put it in another way:

(pg->scrubber.must_scrub ||
 (time_permit &&
  (load_is_low ||
   (double)diff >= cct->_conf->osd_scrub_max_interval))))

will update the PR with you suggestion!

@tchaikov
tchaikov force-pushed the randomize-scrub-time branch 4 times, most recently from 026e63a to e0e4eee Compare March 12, 2015 02:12
@loic-bot

Copy link
Copy Markdown

SUCCESS: the output of run-make-check.sh on centos-7 for 2fe33e24a3c22a0538bc9095b343f467b915b7c8 is http://paste2.org/FsyEchpe

:octocat: Sent from GH.

@loic-bot

Copy link
Copy Markdown

SUCCESS: the output of run-make-check.sh on centos-7 for 61723ff6f8440fdfd56eb2787daf6d1826b634cc is http://paste2.org/4k5WPVY7

:octocat: Sent from GH.

Comment thread src/osd/PG.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@tchaikov

Copy link
Copy Markdown
Contributor Author

@guangyy the idea of having the (min_interval, max_interval) delay is

  1. not to do the next scrub right after this round even if the time permits and system load is low. does it make sense to schedule a scrub shortly after this round? i don't really think so.
  2. to randomly distribute the scrub job in the max_interval.

@guangyy

guangyy commented Mar 12, 2015

Copy link
Copy Markdown
Contributor

@tchaikov , ah yeah, the way to check the diff is also changed, so the problem I explain is not an actual problem..

@athanatos

Copy link
Copy Markdown
Contributor

Oh, sorry, I meant that it should be distributed on [osd_scrub_min_interval, osd_scrub_min_interval + osd_scrub_randomization_interval).

@tchaikov
tchaikov force-pushed the randomize-scrub-time branch from e0e4eee to 1340c41 Compare April 9, 2015 16:26
@tchaikov
tchaikov force-pushed the randomize-scrub-time branch from 1340c41 to 71ff3a3 Compare April 9, 2015 16:56
@tchaikov

tchaikov commented Apr 9, 2015

Copy link
Copy Markdown
Contributor Author

@athanatos comments addressed. added a commit: tchaikov@71ff3a3

@ghost

ghost commented Apr 9, 2015

Copy link
Copy Markdown

@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.

@tchaikov
tchaikov force-pushed the randomize-scrub-time branch from 71ff3a3 to 0c9995b Compare April 10, 2015 03:41
Comment thread src/osd/OSD.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@tchaikov
tchaikov force-pushed the randomize-scrub-time branch from 0c9995b to 0780b14 Compare April 14, 2015 14:33
@liewegas

liewegas commented May 1, 2015

Copy link
Copy Markdown
Member

@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)

@tchaikov

tchaikov commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

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.
[now + osd_scrub_min_interval, now + osd_scrub_min_interval * (1 + f) ).

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
[now + osd_scrub_min_interval, now + osd_scrub_min_interval + osd_scrub_randomization_interval). so it's like 1 day~4 days or 3 months ~ 3months+3days.

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 =).

@tchaikov
tchaikov force-pushed the randomize-scrub-time branch from 987eea5 to c44cbb0 Compare May 4, 2015 06:09
@tchaikov tchaikov assigned liewegas and unassigned tchaikov May 4, 2015
@tchaikov

tchaikov commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

@liewegas could you take a look again? i updated this pull request to address your comments. thanks.

@tchaikov
tchaikov force-pushed the randomize-scrub-time branch 2 times, most recently from df625e2 to 17eae76 Compare May 5, 2015 09:34
@tchaikov
tchaikov force-pushed the randomize-scrub-time branch 2 times, most recently from a67236a to ad0f02b Compare May 12, 2015 03:35
@athanatos

Copy link
Copy Markdown
Contributor

The version I tested (ad0f02b) passed tests.

@athanatos

Copy link
Copy Markdown
Contributor

Also, looks good to me (I agree with osd_scrub_interval_randomize_ratio).

tchaikov added 4 commits May 20, 2015 18:23
avoid unnecessary comparison

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]>
@tchaikov
tchaikov force-pushed the randomize-scrub-time branch from ad0f02b to 6344fc8 Compare May 20, 2015 10:25
@tchaikov

Copy link
Copy Markdown
Contributor Author

@liewegas and @athanatos , thanks for the review and testing!

will merge once the build bot confirms the build.

tchaikov added a commit that referenced this pull request May 20, 2015
osd: Randomize scrub time

Reviewed-by: Sage Weil <[email protected]>
Reviewed-by: Samuel Just <[email protected]>
@tchaikov
tchaikov merged commit 4e272e5 into ceph:master May 20, 2015
@tchaikov
tchaikov deleted the randomize-scrub-time branch May 20, 2015 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants