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.