]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: Reintroduce scrub starts message
authorPrashant D <pdhange@redhat.com>
Tue, 31 May 2022 05:07:47 +0000 (06:07 +0100)
committerPrashant D <pdhange@redhat.com>
Thu, 8 Sep 2022 05:51:05 +0000 (01:51 -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
Resolves: rhbz#2094955

Signed-off-by: Prashant D <pdhange@redhat.com>
(cherry picked from commit 2f6272ac8546070cbc78447c558db47dbdff113c)

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 25e4a83d9e8b4974f0315bcfbdd9a38bf7f6a838..33cee84380ce9932a90919e21a5c89204e6a9aaf 100644 (file)
@@ -2130,6 +2130,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()