mcvsubbu commented on code in PR #13584:
URL: https://github.com/apache/pinot/pull/13584#discussion_r1757332293


##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeSegmentValidationManager.java:
##########
@@ -108,8 +112,36 @@ protected void processTable(String tableNameWithType, 
Context context) {
     if (context._runSegmentLevelValidation) {
       runSegmentLevelValidation(tableConfig, streamConfig);
     }
-    _llcRealtimeSegmentManager.ensureAllPartitionsConsuming(tableConfig, 
streamConfig,
-        context._recreateDeletedConsumingSegment, context._offsetCriteria);
+
+    // Keeps the table paused/unpaused based on storage quota validation.
+    // Skips updating the pause state if table is paused by admin
+    PauseState pauseState = computePauseState(tableNameWithType);
+
+    if (!pauseState.isPaused()) {
+      boolean unPausedUponStorageWithinQuota =
+          
pauseState.getReasonCode().equals(PauseState.ReasonCode.STORAGE_QUOTA_EXCEEDED);
+      _llcRealtimeSegmentManager.ensureAllPartitionsConsuming(tableConfig, 
streamConfig,
+          context._recreateDeletedConsumingSegment || 
unPausedUponStorageWithinQuota, context._offsetCriteria);

Review Comment:
   Let us re-factor this as follows:
   - Create a method called `shouldRestartConsumption()` that returns a boolean
   - Change the original call to `ensureConsuming` to be under an if check 
based on the return of this method
   - The method `shouldRestartConsumption()` returns false if either one of the 
conditions hold: (a) the table has been paused by admin (2) the table is out of 
quota
   
   Agree?



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