FrankChen021 commented on code in PR #20579:
URL: https://github.com/apache/druid/pull/20579#discussion_r4271962205


##########
server/src/main/java/org/apache/druid/client/indexing/ClientCompactionRunnerInfo.java:
##########
@@ -242,8 +243,7 @@ public static CompactionConfigValidationResult 
validateRollupForMSQ(
   public static CompactionConfigValidationResult 
validateMaxNumTasksForMSQ(Map<String, Object> context)
   {
     if (context != null) {
-      int maxNumTasks = QueryContext.of(context)
-                                    
.getInt(ClientMSQContext.CTX_MAX_NUM_TASKS, 
ClientMSQContext.DEFAULT_MAX_NUM_TASKS);
+      final int maxNumTasks = 
QueryContext.of(context).getOrDefault(QueryContextParameters.MAX_NUM_TASKS);

Review Comment:
   Fixed in 8742b60519: a malformed value (e.g. `2.5`) now returns a failed 
`CompactionConfigValidationResult` instead of throwing, with a test.



##########
server/src/main/java/org/apache/druid/server/compaction/CompactionSlotManager.java:
##########
@@ -304,9 +306,7 @@ public static int getMaxTaskSlotsForNativeCompactionTask(
    */
   public static int getMaxTaskSlotsForMSQCompactionTask(@Nullable Map<String, 
Object> context)
   {
-    return context == null
-           ? ClientMSQContext.DEFAULT_MAX_NUM_TASKS
-           : (int) context.getOrDefault(ClientMSQContext.CTX_MAX_NUM_TASKS, 
ClientMSQContext.DEFAULT_MAX_NUM_TASKS);
+    return 
QueryContext.of(context).getOrDefault(QueryContextParameters.MAX_NUM_TASKS);

Review Comment:
   This matches master, which also counts `maxNumTasks` as is here (`(int) 
context.getOrDefault(...)`). Slot accounting intentionally doesn't validate; 
compaction config validation rejects values below 2 before tasks are created, 
and a task submitted with an invalid value fails its own validation. In 
8742b60519 the helper is inlined into its callers, with no behavior change.



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