]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd/scrub: extracting scrub scheduling code from OSD.cc
authorRonen Friedman <rfriedma@redhat.com>
Thu, 22 Apr 2021 07:56:12 +0000 (10:56 +0300)
committerRonen Friedman <rfriedma@redhat.com>
Sat, 18 Sep 2021 10:22:12 +0000 (10:22 +0000)
commitadc8dfb3e5b087a113feef417b5e3c0d63c169f9
tree9d05a0abc252534fad9c6ae084a03ec62e8c2b9b
parent97b6fe661c2a4e106d7449b74f806975fdc8f6fc
osd/scrub: extracting scrub scheduling code from OSD.cc

A separate object (ScrubQueue) now manages the collection of ScrubJob-s
that are to be scrubbed.

Notable changes:
- ScrubQueue keeps track of the CPU load (instead of the OSD main)
- ScrubJob-s are part of each PG's scrubber. They are registered with the
  ScrubQueue when eligible for scrubbing (i.e. - active Primary), and removed
  from it otherwise.
- "a PG is trying to secure Replica resources" was always treated as an OSD-wide
  state that delays new scrubs from starting. Here - it is also implemented as such
  (instead of per-PG state that must be queried)

Internally, the SQ maintains two groups of jobs: the regular ones, waiting to be
scrubbed, and the "penalized" - those PGs that failed in securing their
replicas' scrub resources (@dzafman changes, slightly modified to fit the
new environment)

Also included: minor fixes to the scrub state-machine and events priorities.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
Co-authored-by: David Zafman <dzafman@redhat.com>
18 files changed:
src/crimson/osd/pg.h
src/osd/CMakeLists.txt
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PG.cc
src/osd/PG.h
src/osd/PeeringState.cc
src/osd/PeeringState.h
src/osd/PrimaryLogPG.cc
src/osd/scrubber/osd_scrub_sched.cc [new file with mode: 0644]
src/osd/scrubber/osd_scrub_sched.h [new file with mode: 0644]
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine.h
src/osd/scrubber/scrub_machine_lstnr.h
src/osd/scrubber_common.h
src/test/osd/TestOSDScrub.cc