luwei16 commented on code in PR #19167: URL: https://github.com/apache/doris/pull/19167#discussion_r1181231182
########## fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java: ########## @@ -2538,6 +2541,13 @@ private void createTablets(String clusterName, MaterializedIndex index, ReplicaS if (chooseBackendsArbitrary) { backendsPerBucketSeq = Maps.newHashMap(); } + + Map<Tag, Integer> nextIndexs = new HashMap<>(); + for (Map.Entry<Tag, Short> entry : replicaAlloc.getAllocMap().entrySet()) { + // TODO: random roundrobin starting position + nextIndexs.put(entry.getKey(), 0); Review Comment: > I think of an implementation, for reference: > > 1. Select all candidate BE list according to the conditions (`tag`, `storage_medium`, etc.). > 2. In the list, select the BE with the least number of tablets as the starting node to start executing RoundRobin. > > This method should be logically clearer, which is to separate the step of "filtering BE by condition" from the "execution of RR". done -- 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