Skip to content

Commit c03ca40

Browse files
committed
Address comments
1 parent 7dcc1c7 commit c03ca40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/venice-server/src/main/java/com/linkedin/venice/listener/ReadQuotaEnforcementHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,9 @@ private void handleQuotaUpdateWithoutPartitionAssignment(
540540
StorageEngine storageEngine = storageEngineRepository.getLocalStorageEngine(topic);
541541
if (storageEngine != null) {
542542
double assignedPartitionCount = storageEngine.getPartitionIds().size();
543-
thisNodeQuotaResponsibility = assignedPartitionCount / (double) version.getPartitionCount();
543+
double storeVersionPartitionCount = version.getPartitionCount();
544+
thisNodeQuotaResponsibility =
545+
storeVersionPartitionCount == 0 ? 0 : assignedPartitionCount / storeVersionPartitionCount;
544546
}
545547
LOGGER.info(
546548
"Read quota fallback strategy calculated node responsibility of: {} for resource: {}",

0 commit comments

Comments
 (0)