]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: randomize scrub times to avoid scrub wave
authorKefu Chai <kchai@redhat.com>
Mon, 9 Mar 2015 08:42:34 +0000 (16:42 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 20 May 2015 10:23:21 +0000 (18:23 +0800)
commit5e44040e8528bff06cc0a5a3f3293ab146e0e4e1
tree6a3594a52c28be29517da3bc9859632c8f5175d0
parent0f7f35670f03f3f58329c00d323963710e7e495d
osd: randomize scrub times to avoid scrub wave

- 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: #10973
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/config_opts.h
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PG.cc