{"record":{"id":"66bde550aa6a6564","repo":"apache/druid","slug":"can-t-use-both-maxnumsubtasks-and-maxnumconcurrent","errorCode":null,"errorMessage":"Can't use both maxNumSubTasks and maxNumConcurrentSubTasks. Use maxNumConcurrentSubTasks instead","messagePattern":"Can't use both maxNumSubTasks and maxNumConcurrentSubTasks\\. Use maxNumConcurrentSubTasks instead","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexTuningConfig.java","lineNumber":180,"sourceCode":"        partitionsSpec,\n        indexSpec,\n        indexSpecForIntermediatePersists,\n        maxPendingPersists,\n        forceGuaranteedRollup,\n        reportParseExceptions,\n        null,\n        pushTimeout,\n        segmentWriteOutMediumFactory,\n        logParseExceptions,\n        maxParseExceptions,\n        maxSavedParseExceptions,\n        maxColumnsToMerge,\n        awaitSegmentAvailabilityTimeoutMillis,\n        numPersistThreads\n    );\n\n    if (maxNumSubTasks != null && maxNumConcurrentSubTasks != null) {\n      throw new IAE(\"Can't use both maxNumSubTasks and maxNumConcurrentSubTasks. Use maxNumConcurrentSubTasks instead\");\n    }\n\n    this.splitHintSpec = splitHintSpec;\n\n    if (maxNumConcurrentSubTasks == null) {\n      this.maxNumConcurrentSubTasks = maxNumSubTasks == null ? DEFAULT_MAX_NUM_CONCURRENT_SUB_TASKS : maxNumSubTasks;\n    } else {\n      this.maxNumConcurrentSubTasks = maxNumConcurrentSubTasks;\n    }\n    this.maxRetry = maxRetry == null ? DEFAULT_MAX_RETRY : maxRetry;\n    this.taskStatusCheckPeriodMs = taskStatusCheckPeriodMs == null ?\n                                   DEFAULT_TASK_STATUS_CHECK_PERIOD_MS :\n                                   taskStatusCheckPeriodMs;\n\n    this.chatHandlerTimeout = chatHandlerTimeout == null ? DEFAULT_CHAT_HANDLER_TIMEOUT : chatHandlerTimeout;\n    this.chatHandlerNumRetries = chatHandlerNumRetries == null\n                                 ? DEFAULT_CHAT_HANDLER_NUM_RETRIES\n                                 : chatHandlerNumRetries;","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexTuningConfig.java#L162-L198","documentation":"Thrown in the ParallelIndexTuningConfig constructor when both maxNumSubTasks and maxNumConcurrentSubTasks are set. They are aliases for the same concept; the modern field is maxNumConcurrentSubTasks, so specifying both is ambiguous and rejected with an IAE.","triggerScenarios":"Task JSON or programmatic tuning config containing both keys (e.g. an older spec upgraded by adding maxNumConcurrentSubTasks without removing maxNumSubTasks).","commonSituations":"Upgrading configs across Druid versions where the field was renamed; template-generated specs merging defaults that include both keys; copy-paste from different docs.","solutions":["Remove maxNumSubTasks and keep only maxNumConcurrentSubTasks.","If the config came from a template/defaults merger, deduplicate the keys before submission.","If only maxNumSubTasks is present it is still accepted (treated as concurrency), so removing the newer key also works."],"exampleFix":"// before\n\"tuningConfig\": { \"type\": \"parallel_index\", \"maxNumSubTasks\": 4, \"maxNumConcurrentSubTasks\": 4 }\n// after\n\"tuningConfig\": { \"type\": \"parallel_index\", \"maxNumConcurrentSubTasks\": 4 }","handlingStrategy":"validation","validationCode":"const keys = Object.keys(tuningConfig);\nif (keys.includes('maxNumSubTasks') && keys.includes('maxNumConcurrentSubTasks')) {\n  throw new Error('Set only maxNumConcurrentSubTasks; maxNumSubTasks is a legacy alias');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on maxNumConcurrentSubTasks in all templates","Strip legacy keys when upgrading task JSON across Druid versions","Validate task JSON against the tuning-config schema before submission"],"tags":["tuning-config","validation","conflicting-options"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}