rajagopr commented on code in PR #15008:
URL: https://github.com/apache/pinot/pull/15008#discussion_r1951541886


##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeSegmentValidationManager.java:
##########
@@ -135,6 +138,18 @@ private boolean shouldEnsureConsuming(String 
tableNameWithType) {
     if (isTablePaused && 
pauseStatus.getReasonCode().equals(PauseState.ReasonCode.ADMINISTRATIVE)) {
       return false;
     }
+    try {
+      boolean isResourceUtilizationWithinLimits =
+          
_resourceUtilizationManager.isResourceUtilizationWithinLimits(tableNameWithType);
+      if (!isResourceUtilizationWithinLimits) {
+        LOGGER.warn("Resource utilization limit exceeded for table: {}", 
tableNameWithType);
+        _llcRealtimeSegmentManager.pauseConsumption(tableNameWithType,
+            PauseState.ReasonCode.RESOURCE_UTILIZATION_LIMIT_EXCEEDED, 
"Resource utilization limit exceeded.");
+        return false;

Review Comment:
   No, these tasks would run at different times. They can co-incidentally run 
around the same time. Your point is valid though that the disk utilization info 
can be stale. I will make use of the `lastModifiedTime` added to the DiskInfo 
object to check for staleness. I had added that property for exactly that.



-- 
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