]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/scrub: mark PG as being scrubbed, from scrub initiation to Inactive state 46767/head
authorRonen Friedman <rfriedma@redhat.com>
Mon, 9 Aug 2021 18:20:37 +0000 (18:20 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 26 Jun 2022 09:33:30 +0000 (09:33 +0000)
commitd373a87c404f3ea174ded7707f6a4850c49d65a4
tree91ffb253128511df234edce0583014b438a58fcf
parent4c5ca6f0d4d45680ebabb708e3d9c8cab49927ef
osd/scrub: mark PG as being scrubbed, from scrub initiation to Inactive state

The scrubber's state-machine changes states only following a message dispatched
via the OSD queue. That creates some vulnerability periods, from when the
decision to change the state is made, till when the message carrying the event
is dequeued and processed by the state-machine.

One of the problems thus created is a second scrub being started on a PG, before
the previous scrub is fully terminated and cleaned up.

Here we add a 'being-scrubbed' flag, that is asserted when the first scrub
initiation message is queued and is only cleared when the state machine reaches
Inactive state after the scrub is done.

To note: scrub_finish() is now part of the FSM transition from WaitDigest to Inactive,
closing this specific vulnerability period;

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit 2809a58411f7f5dcecf2caf98e9549842268566f)

Conflicts:
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h
src/osd/pg_scrubber.cc
src/osd/scrub_machine.cc

Conflicts resolved by:
- removing 'scrub-duration' code that was pulled in;
- replacing log lines that used fmtlib;
- completing pieces of scrub_finish() handling that were only partially
  included.
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h
src/osd/PrimaryLogPG.cc
src/osd/pg_scrubber.cc
src/osd/pg_scrubber.h
src/osd/scrub_machine.cc
src/osd/scrub_machine.h
src/osd/scrub_machine_lstnr.h
src/osd/scrubber_common.h