From 73950d303d752899b3954ed1620926bb695cfb87 Mon Sep 17 00:00:00 2001 From: Cory Snyder Date: Fri, 17 Jun 2022 04:29:03 -0400 Subject: [PATCH] osd/scrubber/pg_scrubber.cc: fix bug where scrub machine gets stuck 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 (cherry picked from commit a46a61fdf795af93566dfb8fd92b0b18811083b6) --- src/osd/pg_scrubber.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/osd/pg_scrubber.cc b/src/osd/pg_scrubber.cc index 59372e552fc28..e71d119635273 100644 --- a/src/osd/pg_scrubber.cc +++ b/src/osd/pg_scrubber.cc @@ -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; -- 2.39.5