You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "luwei16 (via GitHub)" <gi...@apache.org> on 2023/04/27 09:49:08 UTC

[GitHub] [doris] luwei16 opened a new pull request, #19167: [feature](table) implement the round robin selection be when create tablet

luwei16 opened a new pull request, #19167:
URL: https://github.com/apache/doris/pull/19167

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] hello-stephen commented on pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #19167:
URL: https://github.com/apache/doris/pull/19167#issuecomment-1528809480

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 33.93 seconds
    stream load tsv:          426 seconds loaded 74807831229 Bytes, about 167 MB/s
    stream load json:         24 seconds loaded 2358488459 Bytes, about 93 MB/s
    stream load orc:          59 seconds loaded 1101869774 Bytes, about 17 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230429151038_clickbench_pr_137382.html


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dataroaring commented on pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "dataroaring (via GitHub)" <gi...@apache.org>.
dataroaring commented on PR #19167:
URL: https://github.com/apache/doris/pull/19167#issuecomment-1528804872

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morningman commented on a diff in pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #19167:
URL: https://github.com/apache/doris/pull/19167#discussion_r1180078624


##########
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:
   If always starts with 0, it will causing the first node always has more tablets than others.
   If intro random start position, than it will be the same as previous implementation



##########
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:
   At very early time, Doris use RR to distribute tablets.
   There was a field `nextBEIdx` in `SystemInfoService`, to save the start position.
   
   But it is hard to maintain that value, because we have to consider `tag`, `storage_medium`, `cluster`, etc. So you have to maintain the `idx` for each combination.
   
   So we changed the distribution method to totally random.
   
   
   



##########
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".



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19167:
URL: https://github.com/apache/doris/pull/19167#issuecomment-1529789977

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19167:
URL: https://github.com/apache/doris/pull/19167#issuecomment-1529790020

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morningman commented on pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on PR #19167:
URL: https://github.com/apache/doris/pull/19167#issuecomment-1531046812

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19167:
URL: https://github.com/apache/doris/pull/19167#issuecomment-1536989125

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] luwei16 commented on a diff in pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "luwei16 (via GitHub)" <gi...@apache.org>.
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morningman merged pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman merged PR #19167:
URL: https://github.com/apache/doris/pull/19167


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] dataroaring commented on pull request #19167: [feature](table) implement the round robin selection be when create tablet

Posted by "dataroaring (via GitHub)" <gi...@apache.org>.
dataroaring commented on PR #19167:
URL: https://github.com/apache/doris/pull/19167#issuecomment-1534373282

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org