]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: replace a ceph_assert() with a test 41944/head
authorRonen Friedman <rfriedma@redhat.com>
Wed, 23 Jun 2021 17:02:28 +0000 (20:02 +0300)
committerRonen Friedman <rfriedma@redhat.com>
Sat, 26 Jun 2021 15:49:09 +0000 (18:49 +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>
(cherry picked from commit 50fbfeffbe76ad683df2dd97e4f65ca6d980e91d)

src/osd/PG.cc

index 7de0d5573c65ddec9149a094bca66e36a30938d5..2a582f3b5273fd1eff7d89d8ce0659bd8d03e17c 100644 (file)
@@ -1336,8 +1336,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;
   }