Tarun-kishore commented on code in PR #19838:
URL: https://github.com/apache/pinot/pull/19838#discussion_r4306453199
##########
pinot-broker/src/main/java/org/apache/pinot/broker/queryquota/HelixExternalViewBasedQueryQuotaManager.java:
##########
@@ -235,13 +239,43 @@ private QuotaConfig
getQuotaConfigFromPropertyStore(String tableNameWithType) {
return tableConfig.getQuotaConfig();
}
+ @Override
+ public QuotaEnforcementMode getQueryQuotaEnforcementMode(String tableName) {
+ List<String> entityNames =
TableNameBuilder.getTableTypeFromTableName(tableName) != null ?
List.of(tableName)
+ : List.of(tableName,
TableNameBuilder.OFFLINE.tableNameWithType(tableName),
+ TableNameBuilder.REALTIME.tableNameWithType(tableName));
+ QuotaEnforcementMode result = null;
+ for (String entityName : entityNames) {
+ // Entries without a QPS quota have a null rate limiter but are still
listed, so their mode is included here. This
+ // is safe because the mode is only consulted after acquire() reported a
breach, which such a table cannot cause.
+ if (!_rateLimiterMap.containsKey(entityName)) {
+ continue;
+ }
+ QuotaEnforcementMode mode =
_enforcementModeOverrideMap.getOrDefault(entityName,
QuotaEnforcementMode.ENFORCED);
+ if (result == null || mode.isStricterThan(result)) {
Review Comment:
Thanks for catching this, the null-limiter sibling's default ENFORCED mode
was winning the resolution for the raw name. getQueryQuotaEnforcementMode now
skips entries whose rate limiter is null (they cannot breach), and I replaced
the comment I added earlier, which didn't hold for hybrid tables
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]