From e79488912ca1b5f6f2b4fa8106270433a05926cf Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Wed, 27 Nov 2024 12:34:53 -0600 Subject: [PATCH] osd/scrub: remove the 'has_deep_errors' scheduling flag Following https://github.com/ceph/ceph/pull/59942 ("osd/scrub: separate shallow vs deep errors storage"), the ScrubStore now holds two separate error databases, one for the shallow errors and one for the deep errors. There is no longer a need to prevent (or warn about) shallow scrubs being performed when deep errors are present. Signed-off-by: Ronen Friedman --- src/osd/PG.cc | 1 - src/osd/scrubber/pg_scrubber.cc | 20 -------------------- src/osd/scrubber_common.h | 6 ++---- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 307651fd6272..cd7cad777bc3 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1278,7 +1278,6 @@ Scrub::schedule_result_t PG::start_scrubbing( pg_cond.allow_deep = !(get_osdmap()->test_flag(CEPH_OSDMAP_NODEEP_SCRUB) || pool.info.has_flag(pg_pool_t::FLAG_NODEEP_SCRUB)); - pg_cond.has_deep_errors = (info.stats.stats.sum.num_deep_scrub_errors > 0); pg_cond.can_autorepair = (cct->_conf->osd_scrub_auto_repair && get_pgbackend()->auto_repair_supported()); diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index aa53df5ae8a1..fea8c7570401 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -2299,26 +2299,6 @@ Scrub::schedule_result_t PgScrubber::start_scrub_session( } } - // restricting shallow scrubs of PGs that have deep errors: - if (pg_cond.has_deep_errors && trgt.is_shallow()) { - if (trgt.urgency() < urgency_t::operator_requested) { - // if there are deep errors, we should have scheduled a deep scrub first. - // If we are here trying to perform a shallow scrub, it means that for some - // reason that deep scrub failed to be initiated. We will not try a shallow - // scrub until this is solved. - dout(10) << __func__ << ": Regular scrub skipped due to deep-scrub errors" - << dendl; - requeue_penalized( - s_or_d, delay_both_targets_t::no, delay_cause_t::pg_state, clock_now); - return schedule_result_t::target_specific_failure; - } else { - // we will honor the request anyway, but will report the issue - m_osds->clog->error() << fmt::format( - "osd.{} pg {} Regular scrub request, deep-scrub details will be lost", - m_osds->whoami, m_pg_id); - } - } - // if only explicitly requested repairing is allowed - skip other types // of scrubbing if (osd_restrictions.allow_requested_repair_only && diff --git a/src/osd/scrubber_common.h b/src/osd/scrubber_common.h index 809107e593bb..2ab5570a7151 100644 --- a/src/osd/scrubber_common.h +++ b/src/osd/scrubber_common.h @@ -109,7 +109,6 @@ static_assert(sizeof(Scrub::OSDRestrictions) <= sizeof(uint32_t)); struct ScrubPGPreconds { bool allow_shallow{true}; bool allow_deep{true}; - bool has_deep_errors{false}; bool can_autorepair{false}; }; static_assert(sizeof(Scrub::ScrubPGPreconds) <= sizeof(uint32_t)); @@ -181,9 +180,8 @@ struct formatter { auto format(const Scrub::ScrubPGPreconds& conds, FormatContext& ctx) const { return fmt::format_to( - ctx.out(), "allowed(shallow/deep):{:1}/{:1},deep-err:{:1},can-autorepair:{:1}", - conds.allow_shallow, conds.allow_deep, conds.has_deep_errors, - conds.can_autorepair); + ctx.out(), "allowed(shallow/deep):{:1}/{:1},can-autorepair:{:1}", + conds.allow_shallow, conds.allow_deep, conds.can_autorepair); } }; -- 2.47.3