]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrubber/pg_scrubber.cc: fix bug where scrub machine gets stuck 46727/head
authorCory Snyder <csnyder@iland.com>
Fri, 17 Jun 2022 08:29:03 +0000 (04:29 -0400)
committerCory Snyder <csnyder@iland.com>
Fri, 17 Jun 2022 08:29:06 +0000 (04:29 -0400)
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>
src/osd/scrubber/pg_scrubber.cc

index bcf74d0e439822f08b887e02de88b1ea53e0dc7a..e96b3e800395adec02dfa116acf45b4c13a33a86 100644 (file)
@@ -127,7 +127,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);
   }
@@ -146,9 +146,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;