tibrewalpratik17 commented on code in PR #14228:
URL: https://github.com/apache/pinot/pull/14228#discussion_r1808684382
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -1815,6 +1821,28 @@ void validateTableTenantConfig(TableConfig tableConfig) {
}
}
+ @VisibleForTesting
+ void validateTableTaskMinionInstanceTagConfig(TableConfig tableConfig) {
+
+ List<InstanceConfig> allMinionWorkerInstanceConfigs =
getAllMinionInstanceConfigs();
+
+ //extract all minionInstanceTags from allMinionWorkerInstanceConfigs
+ Set<String> minionInstanceTagSet =
allMinionWorkerInstanceConfigs.stream().map(InstanceConfig::getTags)
+ .collect(HashSet::new, Set::addAll, Set::addAll);
+
+ if (tableConfig.getTaskConfig() != null &&
tableConfig.getTaskConfig().getTaskTypeConfigsMap() != null) {
+ tableConfig.getTaskConfig().getTaskTypeConfigsMap().forEach((taskType,
taskTypeConfig) -> {
+ String taskInstanceTag =
taskTypeConfig.getOrDefault(PinotTaskManager.MINION_INSTANCE_TAG_CONFIG,
+ CommonConstants.Helix.UNTAGGED_MINION_INSTANCE);
+ if (!minionInstanceTagSet.contains(taskInstanceTag)) {
+ throw new InvalidTableConfigException(
+ String.format("Failed to find minion instances with tag: %s for
table: %s", taskInstanceTag,
Review Comment:
We do check valid minionInstanceTag during task-generation which is common
to adhoc trigger afair --
https://github.com/apache/pinot/blob/9db16254975c9cc46573c51fc16d8d34a2275567/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java#L662-L665
This patch is to proactively prevent table configs from having invalid
minionInstanceTag values.
--
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]