shounakmk219 commented on code in PR #13544:
URL: https://github.com/apache/pinot/pull/13544#discussion_r1701133130


##########
pinot-broker/src/main/java/org/apache/pinot/broker/queryquota/HelixExternalViewBasedQueryQuotaManager.java:
##########
@@ -230,6 +253,114 @@ private void createOrUpdateRateLimiter(String 
tableNameWithType, ExternalView br
     }
   }
 
+  /**
+   * Updates the database rate limiter if it already exists. Will not create a 
new database rate limiter.
+   * @param databaseName database name for which rate limiter needs to be 
updated
+   */
+  public void updateDatabaseRateLimiter(String databaseName) {
+    if (!_databaseRateLimiterMap.containsKey(databaseName)) {
+      return;
+    }
+    createOrUpdateDatabaseRateLimiter(Collections.singletonList(databaseName));
+  }
+
+  public synchronized void createOrUpdateDatabaseRateLimiter(List<String> 
databaseNames) {

Review Comment:
   synchronizing createOrUpdateDatabaseRateLimiter will do an idempotent update 
to the rate limiter so that should be sufficient to ensure there is no stale 
update on the rate limiter due to race condition between updates from default 
quota update on cluster config and override quota provided at database config, 
where default quota config thread ends up overwriting the database config quota.
   We don’t need this at table rate limiter as there is only 1 place where 
query quota config is provided at table level.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to