]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: Reintroduce scrub starts message 47621/head
authorPrashant D <pdhange@redhat.com>
Tue, 31 May 2022 05:07:47 +0000 (06:07 +0100)
committerPrashant D <pdhange@redhat.com>
Tue, 16 Aug 2022 06:30:33 +0000 (02:30 -0400)
Whenever the scrubbing process starts for a PG, We used to log
scrub/deep-scrub "starts" message in the cluster log. We are
not seeing scrub "starts" messages anymore. Reintroduce scrub
starts message in order to calculate exact time taken to
scrub/deep-scrub the PG.

Fixes: https://tracker.ceph.com/issues/55798
Signed-off-by: Prashant D <pdhange@redhat.com>
(cherry picked from commit 2f6272ac8546070cbc78447c558db47dbdff113c)

Conflicts:
src/osd/osd_types_fmt.h: Add formatter for pg_t. Remove
                                 formatter for spg_t, pg_history_t,
                                 pg_info_t and others as they are
                                 not part of quincy yet.

src/osd/osd_types_fmt.h
src/osd/scrubber/pg_scrubber.cc

index deac85c5a570c5395d3b27887d9f6f37d2d53b97..23c0e8a3b81afff95c5058fb94d9e1f09394e010 100644 (file)
@@ -104,3 +104,14 @@ struct fmt::formatter<object_info_t> {
     return fmt::format_to(ctx.out(), ")");
   }
 };
+
+template <>
+struct fmt::formatter<pg_t> {
+  constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
+
+  template <typename FormatContext>
+  auto format(const pg_t& pg, FormatContext& ctx)
+  {
+    return fmt::format_to(ctx.out(), "{}.{:x}", pg.pool(), pg.m_seed);
+  }
+};
index a070245c4eec9585f9a8291a04c4d5e41e812ca0..220d2933cd00b601d8bb8633cabc27a63cd0ea17 100644 (file)
@@ -2128,6 +2128,10 @@ PgScrubber::PgScrubber(PG* pg)
 void PgScrubber::set_scrub_begin_time()
 {
   scrub_begin_stamp = ceph_clock_now();
+  m_osds->clog->debug() << fmt::format(
+    "{} {} starts",
+    m_pg->info.pgid.pgid,
+    m_mode_desc);
 }
 
 void PgScrubber::set_scrub_duration()