Fix StorageServerCollection::addCost write cost calculation

This commit is contained in:
sfc-gh-tclinkenbeard 2022-11-16 07:06:25 -08:00 committed by Trevor Clinkenbeard
parent 9a258e087b
commit 72642c7142
1 changed files with 4 additions and 1 deletions

View File

@ -704,7 +704,10 @@ public:
std::vector<int> const& storageServerIndices,
OpType opType) {
if (storageServerIndices.empty()) {
auto const costPerSS = CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE * (pagesPerSecond / storageServers.size());
auto costPerSS = CLIENT_KNOBS->TAG_THROTTLING_PAGE_SIZE * (pagesPerSecond / storageServers.size());
if (opType == OpType::WRITE) {
costPerSS *= CLIENT_KNOBS->GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO;
}
for (auto& storageServer : storageServers) {
if (opType == OpType::READ) {
storageServer.addReadCost(tag, costPerSS);