]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd/scrub: mark PG as being scrubbed, from scrub initiation to Inactive state
authorRonen Friedman <rfriedma@redhat.com>
Mon, 9 Aug 2021 18:20:37 +0000 (18:20 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 16 Nov 2021 16:05:02 +0000 (16:05 +0000)
commit2809a58411f7f5dcecf2caf98e9549842268566f
tree2338bf68b825d14ac5d31853f883c7ea1c0c71ba
parent44cd7c7650ed2227d3597352b00bd2ef65f4388f
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>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h
src/osd/PrimaryLogPG.cc
src/osd/scrubber/pg_scrubber.cc
src/osd/scrubber/pg_scrubber.h
src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine_lstnr.h
src/osd/scrubber_common.h