This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 62fba5aa5d [Fix](distrubution) fix random tablet (#10756)
62fba5aa5d is described below

commit 62fba5aa5d9b009620e699b6288de99a12afa2ae
Author: lihangyu <15605149...@163.com>
AuthorDate: Mon Jul 11 23:12:56 2022 +0800

    [Fix](distrubution) fix random tablet (#10756)
    
    _compute_tablet_index catched up a local variable
---
 be/src/exec/tablet_info.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/be/src/exec/tablet_info.cpp b/be/src/exec/tablet_info.cpp
index a19410c5c3..71999bb3bb 100644
--- a/be/src/exec/tablet_info.cpp
+++ b/be/src/exec/tablet_info.cpp
@@ -193,9 +193,8 @@ Status OlapTablePartitionParam::init() {
         }
     }
     if (_distributed_slot_descs.empty()) {
-        Random random(UnixMillis());
-        _compute_tablet_index = [&random](Tuple* key, int64_t num_buckets) -> 
uint32_t {
-            return random.Uniform(num_buckets);
+        _compute_tablet_index = [](Tuple* key, int64_t num_buckets) -> 
uint32_t {
+            return butil::fast_rand() % num_buckets;
         };
     } else {
         _compute_tablet_index = [this](Tuple* key, int64_t num_buckets) -> 
uint32_t {
@@ -450,9 +449,8 @@ Status VOlapTablePartitionParam::init() {
         }
     }
     if (_distributed_slot_locs.empty()) {
-        Random random(UnixMillis());
-        _compute_tablet_index = [&random](BlockRow* key, int64_t num_buckets) 
-> uint32_t {
-            return random.Uniform(num_buckets);
+        _compute_tablet_index = [](BlockRow* key, int64_t num_buckets) -> 
uint32_t {
+            return butil::fast_rand() % num_buckets;
         };
     } else {
         _compute_tablet_index = [this](BlockRow* key, int64_t num_buckets) -> 
uint32_t {


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

Reply via email to