Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public long getAvailableBeForTask(long jobId, long previousBeId) throws LoadExce
try {
Map<Long, Integer> beIdToConcurrentTasks = getBeCurrentTasksNumMap();

// 1. Find if the given BE id has available slots
// 1. Find if the given BE id has more than half of available slots
if (previousBeId != -1L && availableBeIds.contains(previousBeId)) {
// get the previousBackend info
Backend previousBackend = Env.getCurrentSystemInfo().getBackend(previousBeId);
Expand All @@ -499,7 +499,7 @@ public long getAvailableBeForTask(long jobId, long previousBeId) throws LoadExce
} else {
idleTaskNum = beIdToMaxConcurrentTasks.get(previousBeId);
}
if (idleTaskNum > 0) {
if (idleTaskNum > (Config.max_routine_load_task_num_per_be >> 1)) {
return previousBeId;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ private void submitTask(long beId, TRoutineLoadTask tTask) throws LoadException
}

// try to allocate a task to BE which has idle slot.
// 1. First is to check if the previous allocated BE is available. If yes, allocate task to previous BE.
// 1. First is to check if the previous allocated BE has more than half of available slots.
// If yes, allocate task to previous BE.
// 2. If not, try to find a better one with most idle slots.
// return true if allocate successfully. return false if failed.
// throw exception if unrecoverable errors happen.
Expand Down