]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: replace a ceph_assert() with a test 41993/head
authorRonen Friedman <rfriedma@redhat.com>
Wed, 23 Jun 2021 17:02:28 +0000 (20:02 +0300)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 23 Jun 2021 17:19:18 +0000 (20:19 +0300)
We are using two distinct conditions to decide whether a candidate PG is already being scrubbed. The OSD checks pgs_scrub_active(), while the PG asserts on the value of PG_STATE_FLAG.
There is a time window when PG_STATE_FLAG is set but is_scrub_active() wasn't yet set. is_reserving() covers most of that period, but the ceph_assert is just before the is_reserving check.

fixes: https://tracker.ceph.com/issues/50346
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/PG.cc

index 4fa4e634d23d2eb2ac60f37acc83e7bbfce241c4..dcc4f8204b8642950e446646126ad6ae2a5d2d65 100644 (file)
@@ -1330,8 +1330,11 @@ bool PG::sched_scrub()
          << (is_active() ? ") <active>" : ") <not-active>")
          << (is_clean() ? " <clean>" : " <not-clean>") << dendl;
   ceph_assert(ceph_mutex_is_locked(_lock));
-  ceph_assert(!is_scrubbing());
 
+  if (m_scrubber && m_scrubber->is_scrub_active()) {
+    return false;
+  }
+  
   if (!is_primary() || !is_active() || !is_clean()) {
     return false;
   }