]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: scheduler refactoring - cleanups
authorRonen Friedman <rfriedma@redhat.com>
Thu, 21 Sep 2023 09:57:30 +0000 (04:57 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 21 Sep 2023 12:57:58 +0000 (07:57 -0500)
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/osd_scrub.cc
src/osd/scrubber/osd_scrub_sched.cc
src/osd/scrubber/osd_scrub_sched.h

index 994a60f0b9a304c2040b52c78fdd91ec023e04a7..1d1e9eb2fe88e7464cbc7bdacc1856089431e1be 100644 (file)
@@ -35,7 +35,7 @@ OsdScrub::OsdScrub(
     , conf{config}
     , m_resource_bookkeeper{[this](std::string msg) { log_fwd(msg); }, conf}
     , m_queue{cct, m_osd_svc}
-    , m_log_prefix{fmt::format("osd.{}: osd-scrub:", m_osd_svc.get_nodeid())}
+    , m_log_prefix{fmt::format("osd.{} osd-scrub:", m_osd_svc.get_nodeid())}
     , m_load_tracker{cct, conf, m_osd_svc.get_nodeid()}
 {}
 
@@ -321,7 +321,7 @@ bool OsdScrub::LoadTracker::scrub_load_below_threshold() const
 {
   double loadavgs[3];
   if (getloadavg(loadavgs, 3) != 3) {
-    dout(10) << fmt::format("{}: couldn't read loadavgs", __func__) << dendl;
+    dout(10) << "couldn't read loadavgs" << dendl;
     return false;
   }
 
@@ -398,7 +398,7 @@ bool OsdScrub::scrub_time_permit(utime_t now) const
   bool time_permits = isbetween_modulo(
       conf->osd_scrub_begin_hour, conf->osd_scrub_end_hour, bdt.tm_hour);
   dout(20) << fmt::format(
-                 "{}: should run between {} - {} now {} = {}", __func__,
+                 "should run between {} - {} now {} = {}",
                  conf->osd_scrub_begin_hour, conf->osd_scrub_end_hour,
                  bdt.tm_hour, (time_permits ? "yes" : "no"))
           << dendl;
index 67933e465a3cc11ab7f70e248bd6764748167d92..5378864f120f35d1135c90b9e56a62d5ac95e4c1 100644 (file)
@@ -477,6 +477,8 @@ ScrubQContainer ScrubQueue::list_registered_jobs() const
   return all_jobs;
 }
 
+// ////////////////////////////////////////////////////////////////////////// //
+// ScrubQueue - maintaining the 'blocked on a locked object' count
 
 void ScrubQueue::clear_pg_scrub_blocked(spg_t blocked_pg)
 {
index 1c73fd6364a900481e4538b5196f92a42c68463c..a2a19f084f1793bc4c363d19fde41faa04bb5a4b 100644 (file)
@@ -335,6 +335,13 @@ class ScrubQueue {
    */
   std::atomic_int_fast16_t blocked_scrubs_cnt{0};
 
+  /**
+   * One of the OSD's primary PGs is in the initial phase of a scrub,
+   * trying to secure its replicas' resources. We will refrain from initiating
+   * any other scrub sessions until this one is done.
+   *
+   * \todo keep the ID of the reserving PG; possibly also the time it started.
+   */
   std::atomic_bool a_pg_is_reserving{false};
 
   /**