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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 6a085f6d4a9 [BUG][COLOCATE] fix colocate balance bug that bucket index 
cannot be set correctly #27741 (#36502)
6a085f6d4a9 is described below

commit 6a085f6d4a910ca37268f1a41ea5db68eff6479d
Author: yujun <yu.jun.re...@gmail.com>
AuthorDate: Wed Jun 19 12:22:55 2024 +0800

    [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set 
correctly #27741 (#36502)
    
    Co-authored-by: shee <13843187+qz...@users.noreply.github.com>
---
 .../org/apache/doris/clone/ColocateTableCheckerAndBalancer.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java
 
b/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java
index d3141a178df..456701213ba 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java
@@ -517,8 +517,9 @@ public class ColocateTableCheckerAndBalancer extends 
MasterDaemon {
                         for (MaterializedIndex index : 
partition.getMaterializedIndices(IndexExtState.VISIBLE)) {
                             Preconditions.checkState(backendBucketsSeq.size() 
== index.getTablets().size(),
                                     backendBucketsSeq.size() + " vs. " + 
index.getTablets().size());
-                            int idx = 0;
-                            for (Long tabletId : index.getTabletIdsInOrder()) {
+                            List<Long> tabletIdsInOrder = 
index.getTabletIdsInOrder();
+                            for (int idx = 0; idx < tabletIdsInOrder.size(); 
idx++) {
+                                Long tabletId = tabletIdsInOrder.get(idx);
                                 counter.totalTabletNum++;
                                 Set<Long> bucketsSeq = 
backendBucketsSeq.get(idx);
                                 Preconditions.checkState(bucketsSeq.size() == 
replicationNum,
@@ -558,7 +559,6 @@ public class ColocateTableCheckerAndBalancer extends 
MasterDaemon {
                                         counter.tabletInScheduler++;
                                     }
                                 }
-                                idx++;
                             }
                         }
                     }


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

Reply via email to