]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add scrub duration for scrubs after recovery 45599/head
authorAishwarya Mathuria <amathuri@redhat.com>
Wed, 23 Mar 2022 17:28:45 +0000 (22:58 +0530)
committerAishwarya Mathuria <amathuri@redhat.com>
Thu, 24 Mar 2022 04:05:14 +0000 (09:35 +0530)
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>
src/osd/scrubber/scrub_machine.cc
src/osd/scrubber/scrub_machine.h

index 2456bdeb2f24986f6b6d8460c90127b4b9370e04..a0e27e250d9765e60d6f105e1f8160415a4b11a3 100644 (file)
@@ -103,6 +103,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 15ed39f3e887298b0cce535649aae818a642ea57..95aff5c6b1c7135ad9c7a2e85afdb0cc843e987a 100644 (file)
@@ -152,12 +152,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> {