liaoxin01 commented on code in PR #65049:
URL: https://github.com/apache/doris/pull/65049#discussion_r3502754759


##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadManager.java:
##########
@@ -616,18 +616,27 @@ protected List<Long> getAvailableBackendIds(long jobId) 
throws LoadException {
             }
 
             if (computeGroup != null && 
!ComputeGroup.INVALID_COMPUTE_GROUP.equals(computeGroup)) {
-                BeSelectionPolicy policy = new 
BeSelectionPolicy.Builder().needLoadAvailable().build();
+                BeSelectionPolicy policy = buildAvailableBackendPolicy(null);
                 return Env.getCurrentSystemInfo()
                         .selectBackendIdsByPolicy(policy, -1 /* as many as 
possible */,
                                 computeGroup.getBackendList());
             } else {
-                BeSelectionPolicy policy = new 
BeSelectionPolicy.Builder().addTags(tags).needLoadAvailable().build();
+                BeSelectionPolicy policy = buildAvailableBackendPolicy(tags);
                 return Env.getCurrentSystemInfo()
                         .selectBackendIdsByPolicy(policy, -1 /* as many as 
possible */);
             }
         }
     }
 
+    static BeSelectionPolicy buildAvailableBackendPolicy(Set<Tag> tags) {
+        BeSelectionPolicy.Builder builder = new 
BeSelectionPolicy.Builder().needLoadAvailable()
+                .needNonDecommissioned();
+        if (tags != null) {

Review Comment:
   Fixed in ffa1749009c: `getAvailableBeForTask()` now only reuses the previous 
BE when it is still in the eligible backend list and load-available. Added a 
unit test covering a decommissioning previous BE with saturated eligible 
backends returning `-1` instead of the previous BE.



-- 
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]

Reply via email to