OIiveirra commented on code in PR #68791:
URL: https://github.com/apache/doris/pull/68791#discussion_r4245203543


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/scan/FederationBackendPolicy.java:
##########
@@ -280,12 +305,20 @@ public Multimap<Backend, Split> 
computeScanRangeAssignment(List<Split> splits) t
                     }
                     case RANDOM: {
                         randomCandidates.reset();
-                        candidateNodes = 
selectNodes(Config.split_assigner_min_random_candidate_num, randomCandidates);
+                        candidateNodes = consistentHashSpreadNum == 0 ? 
backends
+                                : 
selectNodes(Config.split_assigner_min_random_candidate_num, randomCandidates);
                         break;
                     }
                     case CONSISTENT_HASHING: {
-                        candidateNodes = consistentHash.getNode(split,
-                                
Config.split_assigner_min_consistent_hash_candidate_num);
+                        if (consistentHashSpreadNum == 0) {
+                            candidateNodes = backends;
+                        } else {
+                            int candidateCount = isSpreadEnabled()
+                                    ? Math.min(consistentHashSpreadNum, 
backends.size())
+                                    : 
Config.split_assigner_min_consistent_hash_candidate_num;
+                            candidateNodes = candidateCount >= backends.size() 
? backends

Review Comment:
   Preserved the legacy consistent-hash ring order whenever spread is disabled. 
The all-backend shortcut is now used only by spread mode, so the default two-BE 
path retains file-cache affinity and prior tie behavior. Fixed in 22d6ebafe16.



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