]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "Merge pull request #60883 from xxhdx1985126/wip-crimson-backfill-throttle"
authorXuehan Xu <xuxuehan@qianxin.com>
Sun, 2 Mar 2025 05:10:38 +0000 (13:10 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 1 Apr 2025 07:32:37 +0000 (15:32 +0800)
This reverts commit 14463aa7a493dc6903d18af960aac24e8ab8153b, reversing
changes made to 7892d0dd7d594248a8aa6abd81f8f3e018e338ad.

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/osd/backfill_state.cc
src/crimson/osd/backfill_state.h
src/crimson/osd/osd_operation.h
src/crimson/osd/pg_recovery.cc
src/crimson/osd/pg_recovery.h
src/crimson/osd/shard_services.h

index a068c1fa8d41bd95602f865d8d34ceaa2a65e1c0..7fea4b7d5842316255f49b6723ca7d5446360fdf 100644 (file)
@@ -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,
index ea4b159ded92f971e3580466ccb1a879f7a235ed..75129d39745014cbf4ac597259f43f4c97a2b39b 100644 (file)
@@ -62,8 +62,6 @@ struct BackfillState {
   struct SuspendBackfill : sc::event<SuspendBackfill> {
   };
 
-  struct ThrottleAcquired : sc::event<ThrottleAcquired> {
-  };
 private:
   // internal events
   struct RequestPrimaryScanning : sc::event<RequestPrimaryScanning> {
@@ -262,7 +260,6 @@ public:
       sc::transition<RequestDone, Done>,
       sc::custom_reaction<SuspendBackfill>,
       sc::custom_reaction<Triggered>,
-      sc::transition<ThrottleAcquired, Enqueuing>,
       sc::transition<sc::event_base, Crashed>>;
     explicit Waiting(my_context);
     sc::result react(ObjectPushed);
index d702919bd6fae6ca52eceb5086be9399d4751caa..af983eae4ceaa4e4fa7b67a12892c4ee84d38606 100644 (file)
@@ -342,18 +342,6 @@ public:
       with_throttle_while(std::forward<Args>(args)...), *this);
   }
 
-  // Returns std::nullopt if the throttle is acquired immediately,
-  // returns the future for the acquiring otherwise
-  std::optional<seastar::future<>>
-  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;
 
index 735dd7f02e81fabaeaa10702352ccc902295382e..8d5841758e364983141b5cf5e7ca54fb40539b48 100644 (file)
@@ -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<crimson::osd::IOInterruptCondition>;
   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()
index a9a48cf465ce87b7367d0eb24bd8e9ea311d05a0..9d4a4874402f4fc22c782c46d1a336226ca64098 100644 (file)
@@ -25,8 +25,6 @@ class PGBackend;
 
 class PGRecovery : public crimson::osd::BackfillState::BackfillListener {
 public:
-  using interruptor =
-    crimson::interruptible::interruptor<crimson::osd::IOInterruptCondition>;
   template <typename T = void>
   using interruptible_future = RecoveryBackend::interruptible_future<T>;
   PGRecovery(PGRecoveryListener* pg) : pg(pg) {}
index 400976d0db9544b2de8d3ed4a00604c4c267bde8..aa83d3496bc98fc37c4584323e6e27ef4b592e8f 100644 (file)
@@ -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)