diff --git a/fdbserver/Ratekeeper.actor.cpp b/fdbserver/Ratekeeper.actor.cpp index 5657b2b7d4..89c0f0d231 100644 --- a/fdbserver/Ratekeeper.actor.cpp +++ b/fdbserver/Ratekeeper.actor.cpp @@ -475,8 +475,6 @@ Ratekeeper::Ratekeeper(UID id, Database db) SERVER_KNOBS->MAX_TL_SS_VERSION_DIFFERENCE_BATCH, SERVER_KNOBS->TARGET_DURABILITY_LAG_VERSIONS_BATCH) { tagThrottler = std::make_unique(db, id); - expiredTagThrottleCleanup = recurring([this]() { ThrottleApi::expire(this->db.getReference()); }, - SERVER_KNOBS->TAG_THROTTLE_EXPIRED_CLEANUP_INTERVAL); } void Ratekeeper::updateCommitCostEstimation( diff --git a/fdbserver/Ratekeeper.h b/fdbserver/Ratekeeper.h index 2ac8b4c449..28b93266fc 100644 --- a/fdbserver/Ratekeeper.h +++ b/fdbserver/Ratekeeper.h @@ -150,8 +150,6 @@ class Ratekeeper { Deque actualTpsHistory; Optional remoteDC; - Future expiredTagThrottleCleanup; - Ratekeeper(UID id, Database db); Future configurationMonitor(); diff --git a/fdbserver/TagThrottler.actor.cpp b/fdbserver/TagThrottler.actor.cpp index 0f48695ae6..2172051685 100644 --- a/fdbserver/TagThrottler.actor.cpp +++ b/fdbserver/TagThrottler.actor.cpp @@ -383,6 +383,7 @@ class TagThrottlerImpl { RkTagThrottleCollection throttledTags; uint64_t throttledTagChangeId{ 0 }; bool autoThrottlingEnabled{ false }; + Future expiredTagThrottleCleanup; ACTOR static Future monitorThrottlingChanges(TagThrottlerImpl* self) { state bool committed = false; @@ -524,7 +525,10 @@ class TagThrottlerImpl { } public: - TagThrottlerImpl(Database db, UID id) : db(db), id(id) {} + TagThrottlerImpl(Database db, UID id) : db(db), id(id) { + expiredTagThrottleCleanup = recurring([this]() { ThrottleApi::expire(this->db.getReference()); }, + SERVER_KNOBS->TAG_THROTTLE_EXPIRED_CLEANUP_INTERVAL); + } Future monitorThrottlingChanges() { return monitorThrottlingChanges(this); } void addRequests(TransactionTag tag, int count) { throttledTags.addRequests(tag, count); }