From: Aishwarya Mathuria Date: Wed, 23 Mar 2022 17:28:45 +0000 (+0530) Subject: osd: add scrub duration for scrubs after recovery X-Git-Tag: v17.2.6~464^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a7356b53a1f2c525fae3585432c0b5fd6b3ae20b;p=ceph.git osd: add scrub duration for scrubs after recovery Scrub duration is being measured for scheduled scrubs and user-requested scrubs. This change will measure scrub duration for scrubs after recovery as well. Fixes: https://tracker.ceph.com/issues/54994 Signed-off-by: Aishwarya Mathuria (cherry picked from commit 2d836a010ed16c3d89a9cab6adcf72868e3ab729) --- diff --git a/src/osd/scrubber/scrub_machine.cc b/src/osd/scrubber/scrub_machine.cc index 7987559d0261..7187679569d6 100644 --- a/src/osd/scrubber/scrub_machine.cc +++ b/src/osd/scrubber/scrub_machine.cc @@ -104,6 +104,14 @@ sc::result NotActive::react(const StartScrub&) return transit(); } +sc::result NotActive::react(const AfterRepairScrub&) +{ + dout(10) << "NotActive::react(const AfterRepairScrub&)" << dendl; + DECLARE_LOCALS; + scrbr->set_scrub_begin_time(); + return transit(); +} + // ----------------------- ReservingReplicas --------------------------------- ReservingReplicas::ReservingReplicas(my_context ctx) : my_base(ctx) diff --git a/src/osd/scrubber/scrub_machine.h b/src/osd/scrubber/scrub_machine.h index 41669138a9cc..dbdc50d327ad 100644 --- a/src/osd/scrubber/scrub_machine.h +++ b/src/osd/scrubber/scrub_machine.h @@ -154,12 +154,12 @@ struct NotActive : sc::state { explicit NotActive(my_context ctx); using reactions = mpl::list, - // a scrubbing that was initiated at recovery completion, - // and requires no resource reservations: - sc::transition, + // a scrubbing that was initiated at recovery completion + sc::custom_reaction, sc::transition, sc::transition>; sc::result react(const StartScrub&); + sc::result react(const AfterRepairScrub&); }; struct ReservingReplicas : sc::state {