wangbo commented on code in PR #48187: URL: https://github.com/apache/doris/pull/48187#discussion_r1995128978
########## fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadManager.java: ########## @@ -555,24 +560,43 @@ public long getAvailableBeForTask(long jobId, long previousBeId) throws LoadExce * @throws LoadException */ protected List<Long> getAvailableBackendIds(long jobId) throws LoadException { + // Usually Cloud node could not reach here(refer CloudRoutineLoadManager.getAvailableBackendIds), + // check cloud mode here is just to be on the safe side. + if (Config.isCloudMode()) { + throw new LoadException("cloud mode should not reach here"); + } + RoutineLoadJob job = getJob(jobId); if (job == null) { throw new LoadException("job " + jobId + " does not exist"); } - Set<Tag> tags; + Set<Tag> tags = null; + ComputeGroup computeGroup = null; if (job.getUserIdentity() == null) { // For old job, there may be no user info. So we have to use tags from replica allocation tags = getTagsFromReplicaAllocation(job.getDbId(), job.getTableId()); + BeSelectionPolicy policy = new BeSelectionPolicy.Builder().addTags(tags).needLoadAvailable().build(); + return Env.getCurrentSystemInfo() + .selectBackendIdsByPolicy(policy, -1 /* as many as possible */); } else { Review Comment: 加else代码可读性会好点 -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org