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

[PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   ```java
   for (Partition partition : olapTable.getPartitions()) {
       short replicationNum = replicaAlloc.getTotalReplicaNum();
       long visibleVersion = partition.getVisibleVersion();
       // Here we only get VISIBLE indexes. All other indexes are not queryable.
       // So it does not matter if tablets of other indexes are not matched.
       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()) {
               counter.totalTabletNum++;
               Set<Long> bucketsSeq = backendBucketsSeq.get(idx);
               Preconditions.checkState(bucketsSeq.size() == replicationNum,
                       bucketsSeq.size() + " vs. " + replicationNum);
               Tablet tablet = index.getTablet(tabletId);
               TabletStatus st = tablet.getColocateHealthStatus(
                       visibleVersion, replicaAlloc, bucketsSeq);
               if (st != TabletStatus.HEALTHY) {
                   counter.unhealthyTabletNum++;
                   unstableReason = String.format("get unhealthy tablet %d in colocate table."
                           + " status: %s", tablet.getId(), st);
                   LOG.debug(unstableReason);
   
                   if (!tablet.readyToBeRepaired(infoService, Priority.NORMAL)) {
                       counter.tabletNotReady++;
                       // 这里需要将  idx++ ,否则 bucketsSeq和 tablet replicas backends 对应不上
                       idx++;
                       continue;
                   }
   
                   TabletSchedCtx tabletCtx = new TabletSchedCtx(
                           TabletSchedCtx.Type.REPAIR,
                           db.getId(), tableId, partition.getId(), index.getId(), tablet.getId(),
                           replicaAlloc, System.currentTimeMillis());
                   // the tablet status will be set again when being scheduled
                   tabletCtx.setTabletStatus(st);
                   tabletCtx.setPriority(Priority.NORMAL);
                   tabletCtx.setTabletOrderIdx(idx);
   
                   AddResult res = tabletScheduler.addTablet(tabletCtx, false /* not force */);
                   if (res == AddResult.LIMIT_EXCEED || res == AddResult.DISABLED) {
                       // tablet in scheduler exceed limit, or scheduler is disabled,
                       // skip this group and check next one.
                       LOG.info("tablet scheduler return: {}. stop colocate table check", res.name());
                       break OUT;
                   } else if (res == AddResult.ADDED) {
                       counter.addToSchedulerTabletNum++;
                   }  else {
                       counter.tabletInScheduler++;
                   }
               }
               idx++;
           }
       }
   }
   ```
   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## 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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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


##########
fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java:
##########
@@ -530,6 +530,7 @@ private void matchGroups() {
 
                                     if (!tablet.readyToBeRepaired(infoService, Priority.NORMAL)) {
                                         counter.tabletNotReady++;
+                                        idx++;

Review Comment:
   no forEachWithIndex method in JDK.
   use `fori`



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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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


##########
fe/fe-core/src/main/java/org/apache/doris/clone/ColocateTableCheckerAndBalancer.java:
##########
@@ -530,6 +530,7 @@ private void matchGroups() {
 
                                     if (!tablet.readyToBeRepaired(infoService, Priority.NORMAL)) {
                                         counter.tabletNotReady++;
+                                        idx++;

Review Comment:
   or write as:
   
   index.getTabletIdsInOrder().forEachWithIndex((idx, tablet) -> {
     ....
   });
   
   then we no need to add idx 



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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 43.69 seconds
    stream load tsv:          561 seconds loaded 74807831229 Bytes, about 127 MB/s
    stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          28.7 seconds inserted 10000000 Rows, about 348K ops/s
    storage size: 17162510469 Bytes


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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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


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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   run p0


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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 43.3 seconds
    stream load tsv:          555 seconds loaded 74807831229 Bytes, about 128 MB/s
    stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          28.6 seconds inserted 10000000 Rows, about 349K ops/s
    storage size: 17162424301 Bytes


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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit 04277fe41515ce28ad8e1fab0538b2e8dfbfbae6, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4887	4652	4649	4649
   q2	357	157	141	141
   q3	1528	1345	1281	1281
   q4	1154	971	988	971
   q5	3294	3234	3246	3234
   q6	253	129	129	129
   q7	1004	514	557	514
   q8	2222	2252	2236	2236
   q9	6988	6948	6969	6948
   q10	3285	3367	3408	3367
   q11	341	204	213	204
   q12	349	208	215	208
   q13	4631	3891	3841	3841
   q14	252	223	221	221
   q15	581	544	524	524
   q16	460	393	372	372
   q17	1066	689	581	581
   q18	8014	7513	7412	7412
   q19	1561	1570	1559	1559
   q20	527	314	314	314
   q21	3404	2959	3051	2959
   q22	367	299	305	299
   Total cold run time: 46525 ms
   Total hot run time: 41964 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4582	4600	4595	4595
   q2	328	215	202	202
   q3	3773	3760	3760	3760
   q4	2521	2523	2511	2511
   q5	6223	6212	6203	6203
   q6	246	124	128	124
   q7	2712	2017	1994	1994
   q8	3776	3711	3730	3711
   q9	9472	9451	9429	9429
   q10	4078	4157	4159	4157
   q11	659	512	485	485
   q12	822	657	628	628
   q13	4336	3597	3641	3597
   q14	282	256	244	244
   q15	581	536	517	517
   q16	520	485	484	484
   q17	2132	2111	2115	2111
   q18	9699	9017	9096	9017
   q19	1800	1786	1779	1779
   q20	2316	2002	1988	1988
   q21	7285	6963	6900	6900
   q22	673	573	534	534
   Total cold run time: 68816 ms
   Total hot run time: 64970 ms
   ```
   </details>
   


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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   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


Re: [PR] [BUG][COLOCATE] fix colocate balance bug that bucket index cannot be set correctly [doris]

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

   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