From 85d78126429275e3a1057610d810d6244ec188e1 Mon Sep 17 00:00:00 2001 From: tibrewalpratik Date: Mon, 6 May 2024 23:47:16 +0530 Subject: [PATCH 1/2] Bugfix: Validate minionInstanceTag during task-generation --- .../pinot/controller/helix/core/minion/PinotTaskManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java index 97417d6bea94..bda73e95f8f9 100644 --- a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java +++ b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java @@ -659,6 +659,11 @@ private List scheduleTask(PinotTaskGenerator taskGenerator, List 0) { // This might lead to lot of logs, maybe sum it up and move outside the loop + if (_pinotHelixResourceManager.getInstancesWithTag(minionInstanceTag).isEmpty()) { + LOGGER.error("Skipping {} tasks for task type: {} with task configs: {} to invalid minionInstance: {}", + numTasks, taskType, pinotTaskConfigs, minionInstanceTag); + throw new IllegalArgumentException("No valid minion instance found for tag: " + minionInstanceTag); + } LOGGER.info("Submitting {} tasks for task type: {} to minionInstance: {} with task configs: {}", numTasks, taskType, minionInstanceTag, pinotTaskConfigs); String submittedTaskName = _helixTaskResourceManager.submitTask(pinotTaskConfigs, minionInstanceTag, From a0047f1410895321170e12616ba316c42f70321c Mon Sep 17 00:00:00 2001 From: tibrewalpratik Date: Wed, 8 May 2024 11:17:43 +0530 Subject: [PATCH 2/2] address comments --- .../pinot/controller/helix/core/minion/PinotTaskManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java index bda73e95f8f9..1de3d3eb364d 100644 --- a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java +++ b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java @@ -658,12 +658,12 @@ private List scheduleTask(PinotTaskGenerator taskGenerator, List 0) { - // This might lead to lot of logs, maybe sum it up and move outside the loop if (_pinotHelixResourceManager.getInstancesWithTag(minionInstanceTag).isEmpty()) { - LOGGER.error("Skipping {} tasks for task type: {} with task configs: {} to invalid minionInstance: {}", + LOGGER.error("Skipping {} tasks for task type: {} with task configs: {} to invalid minionInstanceTag: {}", numTasks, taskType, pinotTaskConfigs, minionInstanceTag); throw new IllegalArgumentException("No valid minion instance found for tag: " + minionInstanceTag); } + // This might lead to lot of logs, maybe sum it up and move outside the loop LOGGER.info("Submitting {} tasks for task type: {} to minionInstance: {} with task configs: {}", numTasks, taskType, minionInstanceTag, pinotTaskConfigs); String submittedTaskName = _helixTaskResourceManager.submitTask(pinotTaskConfigs, minionInstanceTag,