]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: earlier response to interval changes
authorRonen Friedman <rfriedma@redhat.com>
Mon, 24 Oct 2022 13:35:52 +0000 (16:35 +0300)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 11 Dec 2022 15:27:42 +0000 (17:27 +0200)
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/pg_scrubber.cc

index 7fb05d0f0471ed38dbe37380ebacdee6124091f5..fc5a7ec9af29bc946b39287e69037c6fb2e96ad5 100644 (file)
@@ -517,6 +517,17 @@ void PgScrubber::on_primary_change(
     m_osds->get_scrub_services().remove_from_osd_queue(m_scrub_job);
   }
 
+  // is there an interval change we should respond to?
+  if (is_primary() && is_scrub_active()) {
+    if (m_interval_start < m_pg->get_same_interval_since()) {
+      dout(10) << fmt::format(
+                   "{}: interval changed ({} -> {}). Aborting active scrub.",
+                   __func__, m_interval_start, m_pg->get_same_interval_since())
+              << dendl;
+      scrub_clear_state();
+    }
+  }
+
   dout(10)
     << fmt::format(
         "{} (from {} {}): {}. <{:.5}>&<{:.10}> --> <{:.5}>&<{:.14}>",