From: Samuel Just Date: Tue, 7 Mar 2023 23:09:22 +0000 (-0800) Subject: osd/: remove PeeringListener::on_info_history_change() X-Git-Tag: v19.0.0~1389^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=948e8ee394c374332b3043de09f5b67078a86418;p=ceph.git osd/: remove PeeringListener::on_info_history_change() The only usage of this method was to notify scrub that the pg history has been updated during split or peering. That shouldn't be necessary. Scrub does not schedule itself prior to activation, and we necessarily must have an authoritative history by that point. Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index c6a806a53a35..d510a7145f9b 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -159,10 +159,6 @@ public: bool need_write_epoch, ceph::os::Transaction &t) final; - void on_info_history_change() final { - // Not needed yet -- mainly for scrub scheduling - } - /// Need to reschedule next scrub. Assuming no change in role void reschedule_scrub() final { } diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 35bf0e6409a9..eff053937a1e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -8766,13 +8766,6 @@ bool OSD::advance_pg( double old_max_interval = 0, new_max_interval = 0; oldpool->second.opts.get(pool_opts_t::SCRUB_MAX_INTERVAL, &old_max_interval); newpool->second.opts.get(pool_opts_t::SCRUB_MAX_INTERVAL, &new_max_interval); - - // Assume if an interval is change from set to unset or vice versa the actual config - // is different. Keep it simple even if it is possible to call resched_all_scrub() - // unnecessarily. - if (old_min_interval != new_min_interval || old_max_interval != new_max_interval) { - pg->on_info_history_change(); - } } if (new_pg_num && old_pg_num != new_pg_num) { diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3e8bdc7f2151..e7dafda809b6 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1679,21 +1679,6 @@ std::optional PG::validate_scrub_mode() const return upd_flags; } -/* - * Note: on_info_history_change() is used in those two cases where we're not sure - * whether the role of the PG was changed, and if so - was this change relayed to the - * scrub-queue. - */ -void PG::on_info_history_change() -{ - ceph_assert(m_scrubber); - dout(20) << fmt::format( - "{} for a {}", __func__, - (is_primary() ? "Primary" : "non-primary")) - << dendl; - reschedule_scrub(); -} - void PG::reschedule_scrub() { dout(20) << fmt::format( diff --git a/src/osd/PG.h b/src/osd/PG.h index 187760ba5392..ccec091e08c0 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -538,8 +538,6 @@ public: void on_pool_change() override; virtual void plpg_on_pool_change() = 0; - void on_info_history_change() override; - void reschedule_scrub() override; void scrub_requested(scrub_level_t scrub_level, scrub_type_t scrub_type) override; diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index a9583af5abc5..1ef3141ef47f 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -226,7 +226,6 @@ void PeeringState::update_history(const pg_history_t& new_history) << info.history.prior_readable_until_ub << ")" << dendl; } } - pl->on_info_history_change(); } hobject_t PeeringState::earliest_backfill() const @@ -667,7 +666,6 @@ void PeeringState::start_peering_interval( } on_new_interval(); - pl->on_info_history_change(); psdout(1) << "up " << oldup << " -> " << up << ", acting " << oldacting << " -> " << acting @@ -6570,7 +6568,6 @@ boost::statechart::result PeeringState::Stray::react(const MLogRec& logevt) if (msg->info.last_backfill == hobject_t()) { // restart backfill ps->info = msg->info; - pl->on_info_history_change(); ps->dirty_info = true; ps->dirty_big_info = true; // maybe. diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index a70962072c5c..b1c8b0bb40f6 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -279,9 +279,6 @@ public: bool need_write_epoch, ObjectStore::Transaction &t) = 0; - /// Notify that info/history changed (generally to update scrub registration) - virtual void on_info_history_change() = 0; - /// Need to reschedule next scrub. Assuming no change in role virtual void reschedule_scrub() = 0;