]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrubber/pg_scrubber.cc: fix bug where scrub machine gets stuck 46845/head
authorCory Snyder <csnyder@iland.com>
Fri, 17 Jun 2022 08:29:03 +0000 (04:29 -0400)
committerRonen Friedman <rfriedma@redhat.com>
Sat, 25 Jun 2022 07:35:23 +0000 (10:35 +0300)
Fixes a scenario where the scrub machine gets stuck if starting
a deep scrub while the noscrub flag is set. It was dropping a
scrub reschedule op, without clearing scrub state, leaving the FSM
stuck in ActiveScrubbing,PendingTimer state.

Fixes: https://tracker.ceph.com/issues/54172
Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit a46a61fdf795af93566dfb8fd92b0b18811083b6)

src/osd/pg_scrubber.cc

index 59372e552fc2875d5ad1e51651c92db9fa752c12..e71d11963527337ce0324a09398e59b6c14209f1 100644 (file)
@@ -118,7 +118,7 @@ bool PgScrubber::verify_against_abort(epoch_t epoch_to_verify)
           << " vs last-aborted: " << m_last_aborted << dendl;
 
   // if we were not aware of the abort before - kill the scrub.
-  if (epoch_to_verify > m_last_aborted) {
+  if (epoch_to_verify >= m_last_aborted) {
     scrub_clear_state();
     m_last_aborted = std::max(epoch_to_verify, m_epoch_start);
   }
@@ -137,9 +137,7 @@ bool PgScrubber::should_abort() const
       dout(10) << "nodeep_scrub set, aborting" << dendl;
       return true;
     }
-  }
-
-  if (get_osdmap()->test_flag(CEPH_OSDMAP_NOSCRUB) ||
+  } else if (get_osdmap()->test_flag(CEPH_OSDMAP_NOSCRUB) ||
       m_pg->pool.info.has_flag(pg_pool_t::FLAG_NOSCRUB)) {
     dout(10) << "noscrub set, aborting" << dendl;
     return true;