Skip to content

Commit

Permalink
Skip task scheduling error entries while processing scheduled tasks (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shounakmk219 authored Jan 20, 2025
1 parent 4f41d2b commit fbbabd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public class PinotTaskRestletResource {

private static final String TASK_QUEUE_STATE_STOP = "STOP";
private static final String TASK_QUEUE_STATE_RESUME = "RESUME";
public static final String GENERATION_ERRORS_KEY = "generationErrors";
public static final String SCHEDULING_ERRORS_KEY = "schedulingErrors";

@Inject
PinotHelixTaskResourceManager _pinotHelixTaskResourceManager;
Expand Down Expand Up @@ -667,8 +669,8 @@ public Map<String, String> scheduleTasks(
schedulingErrors.addAll(value.getSchedulingErrors());
});
}
response.put("generationErrors", String.join(",", generationErrors));
response.put("schedulingErrors", String.join(",", schedulingErrors));
response.put(GENERATION_ERRORS_KEY, String.join(",", generationErrors));
response.put(SCHEDULING_ERRORS_KEY, String.join(",", schedulingErrors));
return response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.pinot.common.auth.AuthProviderUtils;
import org.apache.pinot.common.minion.MinionClient;
import org.apache.pinot.common.utils.tls.TlsUtils;
import org.apache.pinot.controller.api.resources.PinotTaskRestletResource;
import org.apache.pinot.core.common.MinionConstants;
import org.apache.pinot.spi.auth.AuthProvider;
import org.apache.pinot.spi.config.table.TableConfig;
Expand Down Expand Up @@ -308,6 +309,11 @@ private boolean waitForMinionTaskToFinish(Map<String, String> scheduledTasks, lo
try {
boolean allCompleted = true;
for (String taskType : scheduledTasks.keySet()) {
// ignore the error message entries
if (taskType.equals(PinotTaskRestletResource.GENERATION_ERRORS_KEY)
|| taskType.equals(PinotTaskRestletResource.SCHEDULING_ERRORS_KEY)) {
continue;
}
String taskName = scheduledTasks.get(taskType);
String taskState = _minionClient.getTaskState(taskName);
if (!COMPLETED.equalsIgnoreCase(taskState)) {
Expand Down

0 comments on commit fbbabd4

Please sign in to comment.