mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-16 02:42:23 +08:00
Support throttling multiple tags in TagThrottler::tryUpdateAutoThrottling
This commit is contained in:
parent
bfd145b299
commit
124527a668
@ -187,23 +187,21 @@ public:
|
|||||||
// the future
|
// the future
|
||||||
auto storageQueue = ss.getStorageQueueBytes();
|
auto storageQueue = ss.getStorageQueueBytes();
|
||||||
auto storageDurabilityLag = ss.getDurabilityLag();
|
auto storageDurabilityLag = ss.getDurabilityLag();
|
||||||
|
std::vector<Future<Void>> futures;
|
||||||
if (storageQueue > SERVER_KNOBS->AUTO_TAG_THROTTLE_STORAGE_QUEUE_BYTES ||
|
if (storageQueue > SERVER_KNOBS->AUTO_TAG_THROTTLE_STORAGE_QUEUE_BYTES ||
|
||||||
storageDurabilityLag > SERVER_KNOBS->AUTO_TAG_THROTTLE_DURABILITY_LAG_VERSIONS) {
|
storageDurabilityLag > SERVER_KNOBS->AUTO_TAG_THROTTLE_DURABILITY_LAG_VERSIONS) {
|
||||||
// TODO: Update once size is potentially > 1
|
|
||||||
ASSERT_WE_THINK(ss.busiestWriteTags.size() <= 1);
|
|
||||||
ASSERT_WE_THINK(ss.busiestReadTags.size() <= 1);
|
|
||||||
for (const auto& busyWriteTag : ss.busiestWriteTags) {
|
for (const auto& busyWriteTag : ss.busiestWriteTags) {
|
||||||
return tryUpdateAutoThrottling(busyWriteTag.tag,
|
futures.push_back(tryUpdateAutoThrottling(busyWriteTag.tag,
|
||||||
busyWriteTag.rate,
|
busyWriteTag.rate,
|
||||||
busyWriteTag.fractionalBusyness,
|
busyWriteTag.fractionalBusyness,
|
||||||
TagThrottledReason::BUSY_WRITE);
|
TagThrottledReason::BUSY_WRITE));
|
||||||
}
|
}
|
||||||
for (const auto& busyReadTag : ss.busiestReadTags) {
|
for (const auto& busyReadTag : ss.busiestReadTags) {
|
||||||
return tryUpdateAutoThrottling(
|
futures.push_back(tryUpdateAutoThrottling(
|
||||||
busyReadTag.tag, busyReadTag.rate, busyReadTag.fractionalBusyness, TagThrottledReason::BUSY_READ);
|
busyReadTag.tag, busyReadTag.rate, busyReadTag.fractionalBusyness, TagThrottledReason::BUSY_READ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Void();
|
return waitForAll(futures);
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // class TagThrottlerImpl
|
}; // class TagThrottlerImpl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user