From: Xuehan Xu Date: Sun, 2 Mar 2025 05:10:38 +0000 (+0800) Subject: Revert "Merge pull request #60883 from xxhdx1985126/wip-crimson-backfill-throttle" X-Git-Tag: v20.3.0~159^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=895d52cd69b12afc0616429826f2f9bcbc5e1b81;p=ceph.git Revert "Merge pull request #60883 from xxhdx1985126/wip-crimson-backfill-throttle" This reverts commit 14463aa7a493dc6903d18af960aac24e8ab8153b, reversing changes made to 7892d0dd7d594248a8aa6abd81f8f3e018e338ad. Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/osd/backfill_state.cc b/src/crimson/osd/backfill_state.cc index a068c1fa8d41..7fea4b7d5842 100644 --- a/src/crimson/osd/backfill_state.cc +++ b/src/crimson/osd/backfill_state.cc @@ -342,7 +342,6 @@ BackfillState::Enqueuing::Enqueuing(my_context ctx) do { if (!backfill_listener().budget_available()) { - DEBUGDPP("throttle failed, turning to Waiting", pg()); post_event(RequestWaiting{}); return; } else if (should_rescan_replicas(backfill_state().peer_backfill_info, diff --git a/src/crimson/osd/backfill_state.h b/src/crimson/osd/backfill_state.h index ea4b159ded92..75129d397450 100644 --- a/src/crimson/osd/backfill_state.h +++ b/src/crimson/osd/backfill_state.h @@ -62,8 +62,6 @@ struct BackfillState { struct SuspendBackfill : sc::event { }; - struct ThrottleAcquired : sc::event { - }; private: // internal events struct RequestPrimaryScanning : sc::event { @@ -262,7 +260,6 @@ public: sc::transition, sc::custom_reaction, sc::custom_reaction, - sc::transition, sc::transition>; explicit Waiting(my_context); sc::result react(ObjectPushed); diff --git a/src/crimson/osd/osd_operation.h b/src/crimson/osd/osd_operation.h index d702919bd6fa..af983eae4cea 100644 --- a/src/crimson/osd/osd_operation.h +++ b/src/crimson/osd/osd_operation.h @@ -342,18 +342,6 @@ public: with_throttle_while(std::forward(args)...), *this); } - // Returns std::nullopt if the throttle is acquired immediately, - // returns the future for the acquiring otherwise - std::optional> - try_acquire_throttle_now(crimson::osd::scheduler::params_t params) { - if (!max_in_progress || in_progress < max_in_progress) { - ++in_progress; - --pending; - return std::nullopt; - } - return acquire_throttle(params); - } - private: void dump_detail(Formatter *f) const final; diff --git a/src/crimson/osd/pg_recovery.cc b/src/crimson/osd/pg_recovery.cc index 735dd7f02e81..8d5841758e36 100644 --- a/src/crimson/osd/pg_recovery.cc +++ b/src/crimson/osd/pg_recovery.cc @@ -67,6 +67,8 @@ PGRecovery::start_recovery_ops( if (max_to_start > 0) { max_to_start -= start_replica_recovery_ops(trigger, max_to_start, &started); } + using interruptor = + crimson::interruptible::interruptor; return interruptor::parallel_for_each(started, [] (auto&& ifut) { return std::move(ifut); @@ -603,21 +605,8 @@ void PGRecovery::update_peers_last_backfill( bool PGRecovery::budget_available() const { - crimson::osd::scheduler::params_t params = - {1, 0, crimson::osd::scheduler::scheduler_class_t::background_best_effort}; - auto &ss = pg->get_shard_services(); - auto futopt = ss.try_acquire_throttle_now(std::move(params)); - if (!futopt) { - return true; - } - std::ignore = interruptor::make_interruptible(std::move(*futopt) - ).then_interruptible([this] { - assert(!backfill_state->is_triggered()); - using BackfillState = crimson::osd::BackfillState; - backfill_state->process_event( - BackfillState::ThrottleAcquired{}.intrusive_from_this()); - }); - return false; + // TODO: the limits! + return true; } void PGRecovery::on_pg_clean() diff --git a/src/crimson/osd/pg_recovery.h b/src/crimson/osd/pg_recovery.h index a9a48cf465ce..9d4a4874402f 100644 --- a/src/crimson/osd/pg_recovery.h +++ b/src/crimson/osd/pg_recovery.h @@ -25,8 +25,6 @@ class PGBackend; class PGRecovery : public crimson::osd::BackfillState::BackfillListener { public: - using interruptor = - crimson::interruptible::interruptor; template using interruptible_future = RecoveryBackend::interruptible_future; PGRecovery(PGRecoveryListener* pg) : pg(pg) {} diff --git a/src/crimson/osd/shard_services.h b/src/crimson/osd/shard_services.h index 400976d0db95..aa83d3496bc9 100644 --- a/src/crimson/osd/shard_services.h +++ b/src/crimson/osd/shard_services.h @@ -594,7 +594,6 @@ public: FORWARD_TO_OSD_SINGLETON(get_pool_info) FORWARD(with_throttle_while, with_throttle_while, local_state.throttler) - FORWARD(try_acquire_throttle_now, try_acquire_throttle_now, local_state.throttler) FORWARD_TO_OSD_SINGLETON(build_incremental_map_msg) FORWARD_TO_OSD_SINGLETON(send_incremental_map)