You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/11 04:34:32 UTC

[GitHub] [doris] eldenmoon opened a new issue, #10755: [Bug] DISTRIBUTED BY RANDOM BUCKETS is not random

eldenmoon opened a new issue, #10755:
URL: https://github.com/apache/doris/issues/10755

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   master
   
   ### What's Wrong?
   
   Insert values to the table which `DISTRIBUTED BY RANDOM BUCKETS 5` always pick the tablet at index 4 to write date
   
   
   ### What You Expected?
   
   write data randomly
   
   ### How to Reproduce?
   
   ```
   CREATE TABLE IF NOT EXISTS test_randome_dist (id int) DUPLICATE KEY(`id`)   DISTRIBUTED BY RANDOM BUCKETS 5  properties("replication_num" = "1");
   
   MySQL [test_distribution]> insert into test_randome_dist values(2);
   Query OK, 1 row affected (0.04 sec)
   {'label':'insert_5093de075c2d4595-85a137603d3990f4', 'status':'VISIBLE', 'txnId':'26'}
   
   MySQL [test_distribution]> insert into test_randome_dist values(3);
   Query OK, 1 row affected (0.03 sec)
   {'label':'insert_5cc9a837859344a5-91f4f14fffcadb9e', 'status':'VISIBLE', 'txnId':'27'}
   
   MySQL [test_distribution]> insert into test_randome_dist values(4);
   Query OK, 1 row affected (0.03 sec)
   {'label':'insert_c9e6b278c7674fae-857c2af96c8a1f83', 'status':'VISIBLE', 'txnId':'28'}
   
   MySQL [test_distribution]> insert into test_randome_dist values(5);
   Query OK, 1 row affected (0.04 sec)
   {'label':'insert_91807ad22ca148e4-a2139fa9c453701d', 'status':'VISIBLE', 'txnId':'29'}
   ```
   
   I add logs to the tablet index generation func
   ```
   if (_distributed_slot_locs.empty()) {
           Random random(UnixMillis());
           _compute_tablet_index = [&random](BlockRow* key, int64_t num_buckets) -> uint32_t {
               auto rand_tablet = random.Uniform(num_buckets);
               LOG(WARNING) << "distributed random tablet:" << rand_tablet;
               return rand_tablet;
           };
       }
   ```
   
   and bellow is the out  put logs 
   
   ```
   W0711 12:28:12.790746 17774 tablet_info.cpp:458] distributed random tablet:4
   W0711 12:28:13.416414 17780 tablet_info.cpp:458] distributed random tablet:4
   W0711 12:28:14.094108 17771 tablet_info.cpp:458] distributed random tablet:4
   W0711 12:28:14.693032 17771 tablet_info.cpp:458] distributed random tablet:4
   W0711 12:28:15.408915 17773 tablet_info.cpp:458] distributed random tablet:4
   W0711 12:28:16.030279 17765 tablet_info.cpp:458] distributed random tablet:4
   W0711 12:28:16.949088 17780 tablet_info.cpp:458] distributed random tablet:4
   ```
   
   you could see the tablet at index 4 is always picked as the destination tablet
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.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 closed issue #10755: [Bug] DISTRIBUTED BY RANDOM BUCKETS is not random

Posted by GitBox <gi...@apache.org>.
dataroaring closed issue #10755: [Bug] DISTRIBUTED BY RANDOM BUCKETS is not random
URL: https://github.com/apache/doris/issues/10755


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