swaminathanmanish commented on code in PR #16571:
URL: https://github.com/apache/pinot/pull/16571#discussion_r2269411904


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java:
##########
@@ -739,6 +748,21 @@ protected TaskSchedulingInfo 
scheduleTask(PinotTaskGenerator taskGenerator, List
         List<PinotTaskConfig> presentTaskConfig =
             minionInstanceTagToTaskConfigs.computeIfAbsent(minionInstanceTag, 
k -> new ArrayList<>());
         taskGenerator.generateTasks(List.of(tableConfig), presentTaskConfig);
+        int maxNumberOfSubTasks = taskGenerator.getMaxNumSubTasks();
+        // choose first maxNumberOfSubTasks tasks to schedule from 
presentTaskConfig
+        if (presentTaskConfig.size() > maxNumberOfSubTasks) {
+          LOGGER.warn("Number of tasks generated for task type: {} for table: 
{} is {}, which is greater than the "
+              + "maximum number of tasks to schedule: {}. Only the first {} 
tasks will be scheduled. This is controlled"
+                  + " by the cluster config maxAllowedSubTasks which is set 
based on controller's performance",
+              taskType, tableName, presentTaskConfig.size(), 
maxNumberOfSubTasks, maxNumberOfSubTasks);
+          presentTaskConfig = new ArrayList<>(presentTaskConfig.subList(0, 
maxNumberOfSubTasks));

Review Comment:
   When we override here, taskConfig will show the user configured value, but 
we will be using a different value (On minion task manager, when we look at 
task metadata) . Would that be confusing? 
   
   



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

Reply via email to