]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add scrub duration for scrubs after recovery 47926/head
authorAishwarya Mathuria <amathuri@redhat.com>
Wed, 23 Mar 2022 17:28:45 +0000 (22:58 +0530)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 2 Sep 2022 16:33:49 +0000 (16:33 +0000)
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 <amathuri@redhat.com>
(cherry picked from commit 2d836a010ed16c3d89a9cab6adcf72868e3ab729)

src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine.h

index 7987559d0261f1cd399fd3fc5daa7ae1a0ca2d38..7187679569d633bd7ac6f9da0286c89b1d4337de 100644 (file)
@@ -104,6 +104,14 @@ sc::result NotActive::react(const StartScrub&)
   return transit<ReservingReplicas>();
 }
 
+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::ReservingReplicas(my_context ctx) : my_base(ctx)
index 41669138a9cc2fb6dedc0a343439014537092629..dbdc50d327adb59710b98774f40e2438309aeda1 100644 (file)
@@ -154,12 +154,12 @@ struct NotActive : sc::state<NotActive, ScrubMachine> {
   explicit NotActive(my_context ctx);
 
   using reactions = mpl::list<sc::custom_reaction<StartScrub>,
-                             // a scrubbing that was initiated at recovery completion,
-                             // and requires no resource reservations:
-                             sc::transition<AfterRepairScrub, ReservingReplicas>,
+                             // a scrubbing that was initiated at recovery completion
+                             sc::custom_reaction<AfterRepairScrub>,
                              sc::transition<StartReplica, ReplicaWaitUpdates>,
                              sc::transition<StartReplicaNoWait, ActiveReplica>>;
   sc::result react(const StartScrub&);
+  sc::result react(const AfterRepairScrub&);
 };
 
 struct ReservingReplicas : sc::state<ReservingReplicas, ScrubMachine> {