From 83b8ca54bb9b80fbdd560112589eee9d903fec6c Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Thu, 5 Sep 2024 11:14:23 -0500 Subject: [PATCH] osd/scrub: remove remaining refs to the Scrubber's 'required' flag and the flag itself Signed-off-by: Ronen Friedman --- src/osd/scrubber/pg_scrubber.cc | 24 ++++++++++-------------- src/osd/scrubber/pg_scrubber.h | 10 ---------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index d0135091ad9..b5081f56aba 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -55,8 +55,6 @@ ostream& operator<<(ostream& out, const scrub_flags_t& sf) out << " CHECK_REPAIR"; if (sf.deep_scrub_on_error) out << " DEEP_SCRUB_ON_ERROR"; - if (sf.required) - out << " REQ_SCRUB"; return out; } @@ -1700,8 +1698,6 @@ void PgScrubber::set_op_parameters( m_flags.check_repair = m_active_target->urgency() == urgency_t::after_repair; m_flags.auto_repair = false; - m_flags.required = request.req_scrub || request.must_scrub; - m_flags.priority = (request.must_scrub || request.need_auto) ? get_pg_cct()->_conf->osd_requested_scrub_priority : m_pg->get_scrub_priority(); @@ -2022,12 +2018,13 @@ void PgScrubber::scrub_finish() } else if (has_error) { - // Deep scrub in order to get corrected error counts + // a recovery will be initiated (below). Arrange for a deep-scrub + // after the recovery, to get the updated error counts. m_after_repair_scrub_required = true; - m_planned_scrub.req_scrub = m_planned_scrub.req_scrub || m_flags.required; - - dout(20) << __func__ << " Current 'required': " << m_flags.required - << " Planned 'req_scrub': " << m_planned_scrub.req_scrub + dout(20) << fmt::format( + "{}: setting for deep-scrub-after-repair ({} errors. {} " + "errors fixed)", + __func__, m_shallow_errors + m_deep_errors, m_fixed_count) << dendl; } else if (m_shallow_errors || m_deep_errors) { @@ -2183,10 +2180,8 @@ void PgScrubber::on_mid_scrub_abort(Scrub::delay_cause_t issue) // e.g. - the 'aborted_schedule' data should be passed thru the scrubber. // In this current patchwork, for example, we are only guessing at // the original value of 'must_deep_scrub'. - m_planned_scrub.must_deep_scrub = - m_planned_scrub.must_deep_scrub || (m_flags.required && m_is_deep); m_planned_scrub.must_scrub = m_planned_scrub.must_deep_scrub || - m_planned_scrub.must_scrub || m_flags.required; + m_planned_scrub.must_scrub; m_planned_scrub.must_repair = m_planned_scrub.must_repair || m_is_repair; m_planned_scrub.need_auto = m_planned_scrub.need_auto || m_flags.auto_repair; @@ -2450,7 +2445,7 @@ void PgScrubber::dump_active_scrubber(ceph::Formatter* f) const f->dump_bool("deep", m_active_target->is_deep()); // dump the scrub-type flags - f->dump_bool("req_scrub", m_flags.required); + f->dump_bool("req_scrub", m_active_target->is_high_priority()); f->dump_bool("auto_repair", m_flags.auto_repair); f->dump_bool("check_repair", m_flags.check_repair); f->dump_bool("deep_scrub_on_error", m_flags.deep_scrub_on_error); @@ -2656,7 +2651,8 @@ void PgScrubber::replica_handling_done() std::chrono::milliseconds PgScrubber::get_scrub_sleep_time() const { return m_osds->get_scrub_services().scrub_sleep_time( - ceph_clock_now(), m_flags.required); + ceph_clock_now(), + !ScrubJob::observes_allowed_hours(m_active_target->urgency())); } void PgScrubber::queue_for_scrub_resched(Scrub::scrub_prio_t prio) diff --git a/src/osd/scrubber/pg_scrubber.h b/src/osd/scrubber/pg_scrubber.h index 95da64825ec..d90ad171bdb 100644 --- a/src/osd/scrubber/pg_scrubber.h +++ b/src/osd/scrubber/pg_scrubber.h @@ -156,13 +156,6 @@ struct scrub_flags_t { /// checked at the end of the scrub, to possibly initiate a deep-scrub bool deep_scrub_on_error{false}; - - /** - * scrub must not be aborted. - * Set for explicitly requested scrubs, and for scrubs originated by the - * pairing process with the 'repair' flag set (in the RequestScrub event). - */ - bool required{false}; }; ostream& operator<<(ostream& out, const scrub_flags_t& sf); @@ -188,9 +181,6 @@ struct formatter { txt += sep ? ",deep-scrub-on-error" : "deep-scrub-on-error"; sep = true; } - if (sf.required) { - txt += sep ? ",required" : "required"; - } return fmt::format_to(ctx.out(), "{}", txt); } }; -- 2.39.5