From: Ronen Friedman Date: Mon, 29 Jul 2024 04:34:32 +0000 (-0500) Subject: osd/scrub: remove 'calculated_to_deep' flag X-Git-Tag: v20.0.0~1219^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=159cfd29cf1575c827dc582972f676c4c8796bca;p=ceph.git osd/scrub: remove 'calculated_to_deep' flag as once a sched-target was selected, we know the level of the scrub. Also removed: the ephemeral 'time_for_deep' flag. Signed-off-by: Ronen Friedman --- diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc index 6c2dff17bd7be..9530cff7d7a78 100644 --- a/src/osd/scrubber/pg_scrubber.cc +++ b/src/osd/scrubber/pg_scrubber.cc @@ -73,8 +73,6 @@ ostream& operator<<(ostream& out, const requested_scrub_t& sf) out << " MUST_DEEP_SCRUB"; if (sf.must_scrub) out << " MUST_SCRUB"; - if (sf.time_for_deep) - out << " TIME_FOR_DEEP"; if (sf.need_auto) out << " NEED_AUTO"; if (sf.req_scrub) @@ -1721,13 +1719,10 @@ void PgScrubber::set_op_parameters(const requested_scrub_t& request) state_set(PG_STATE_SCRUBBING); // will we be deep-scrubbing? - if (request.calculated_to_deep) { + m_is_deep = m_active_target->sched_info.level == scrub_level_t::deep; + if (m_is_deep) { state_set(PG_STATE_DEEP_SCRUB); - m_is_deep = true; } else { - m_is_deep = false; - - // make sure we got the 'calculated_to_deep' flag right ceph_assert(!request.must_deep_scrub); ceph_assert(!request.need_auto); } @@ -2353,8 +2348,8 @@ Scrub::schedule_result_t PgScrubber::start_scrub_session( return schedule_result_t::osd_wide_failure; } - // can commit to the updated flags now, as nothing will stop the scrub - //m_planned_scrub = *updated_flags; + // can commit now to the specific scrub details, as nothing will + // stop the scrub // An interrupted recovery repair could leave this set. state_clear(PG_STATE_REPAIR); @@ -2385,7 +2380,7 @@ void PgScrubber::dump_scrubber(ceph::Formatter* f, { f->open_object_section("scrubber"); - if (m_active) { // TBD replace with PR#42780's test + if (m_active_target) { f->dump_bool("active", true); dump_active_scrubber(f, state_test(PG_STATE_DEEP_SCRUB)); } else { diff --git a/src/osd/scrubber_common.h b/src/osd/scrubber_common.h index 8e2e13c97a604..12808f71e7f3e 100644 --- a/src/osd/scrubber_common.h +++ b/src/osd/scrubber_common.h @@ -325,17 +325,6 @@ struct requested_scrub_t { */ bool must_deep_scrub{false}; - /** - * (An intermediary flag used by pg::sched_scrub() on the first time - * a planned scrub has all its resources). Determines whether the next - * repair/scrub will be 'deep'. - * - * Note: 'dumped' by PgScrubber::dump() and such. In reality, being a - * temporary that is set and reset by the same operation, will never - * appear externally to be set - */ - bool time_for_deep{false}; - bool deep_scrub_on_error{false}; /** @@ -350,15 +339,9 @@ struct requested_scrub_t { * the value of auto_repair is determined in sched_scrub() (once per scrub. * previous value is not remembered). Set if * - allowed by configuration and backend, and - * - for periodic scrubs: time_for_deep was just set + * - for periodic scrubs: time_for_deep was just set RRR */ bool auto_repair{false}; - - /** - * Used to indicate, both in client-facing listings and internally, that - * the planned scrub will be a deep one. - */ - bool calculated_to_deep{false}; }; std::ostream& operator<<(std::ostream& out, const requested_scrub_t& sf); @@ -371,16 +354,14 @@ struct fmt::formatter { auto format(const requested_scrub_t& rs, FormatContext& ctx) { return fmt::format_to(ctx.out(), - "(plnd:{}{}{}{}{}{}{}{}{})", + "(plnd:{}{}{}{}{}{}{})", rs.must_repair ? " must_repair" : "", rs.auto_repair ? " auto_repair" : "", rs.deep_scrub_on_error ? " deep_scrub_on_error" : "", rs.must_deep_scrub ? " must_deep_scrub" : "", rs.must_scrub ? " must_scrub" : "", - rs.time_for_deep ? " time_for_deep" : "", rs.need_auto ? " need_auto" : "", - rs.req_scrub ? " req_scrub" : "", - rs.calculated_to_deep ? " deep" : ""); + rs.req_scrub ? " req_scrub" : ""); } };