From 576ab533732538dec456040e85f98029b6b96770 Mon Sep 17 00:00:00 2001 From: sfc-gh-tclinkenbeard Date: Wed, 23 Mar 2022 15:01:59 -0700 Subject: [PATCH] Rename RkTagThrottleCollection::updateBusyTagCount to incrementBusyTagCount --- fdbserver/RkTagThrottleCollection.cpp | 4 +++- fdbserver/RkTagThrottleCollection.h | 2 +- fdbserver/TagThrottler.actor.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fdbserver/RkTagThrottleCollection.cpp b/fdbserver/RkTagThrottleCollection.cpp index 11c376f57d..c58d5eec70 100644 --- a/fdbserver/RkTagThrottleCollection.cpp +++ b/fdbserver/RkTagThrottleCollection.cpp @@ -347,10 +347,12 @@ int64_t RkTagThrottleCollection::manualThrottleCount() const { return count; } -void RkTagThrottleCollection::updateBusyTagCount(TagThrottledReason reason) { +void RkTagThrottleCollection::incrementBusyTagCount(TagThrottledReason reason) { if (reason == TagThrottledReason::BUSY_READ) { ++busyReadTagCount; } else if (reason == TagThrottledReason::BUSY_WRITE) { ++busyWriteTagCount; + } else { + ASSERT(false); } } diff --git a/fdbserver/RkTagThrottleCollection.h b/fdbserver/RkTagThrottleCollection.h index 35062cdb7c..4ccc7ae070 100644 --- a/fdbserver/RkTagThrottleCollection.h +++ b/fdbserver/RkTagThrottleCollection.h @@ -83,7 +83,7 @@ public: void addRequests(TransactionTag const& tag, int requests); int64_t autoThrottleCount() const { return autoThrottledTags.size(); } int64_t manualThrottleCount() const; - void updateBusyTagCount(TagThrottledReason); + void incrementBusyTagCount(TagThrottledReason); auto getBusyReadTagCount() const { return busyReadTagCount; } auto getBusyWriteTagCount() const { return busyWriteTagCount; } }; diff --git a/fdbserver/TagThrottler.actor.cpp b/fdbserver/TagThrottler.actor.cpp index d523a34b15..ce997fe443 100644 --- a/fdbserver/TagThrottler.actor.cpp +++ b/fdbserver/TagThrottler.actor.cpp @@ -107,7 +107,7 @@ class TagThrottlerImpl { if (tagKey.throttleType == TagThrottleType::AUTO) { updatedTagThrottles.autoThrottleTag( self->id, tag, 0, tagValue.tpsRate, tagValue.expirationTime); - updatedTagThrottles.updateBusyTagCount(tagValue.reason); + updatedTagThrottles.incrementBusyTagCount(tagValue.reason); } else { updatedTagThrottles.manualThrottleTag(self->id, tag, @@ -144,6 +144,7 @@ class TagThrottlerImpl { if (busyness > SERVER_KNOBS->AUTO_THROTTLE_TARGET_TAG_BUSYNESS && rate > SERVER_KNOBS->MIN_TAG_COST) { TEST(true); // Transaction tag auto-throttled Optional clientRate = throttledTags.autoThrottleTag(id, tag, busyness); + // TODO: Increment tag throttle counts here? if (clientRate.present()) { TagSet tags; tags.addTag(tag);