github-actions[bot] commented on code in PR #62661:
URL: https://github.com/apache/doris/pull/62661#discussion_r3380025028


##########
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java:
##########
@@ -4561,12 +4570,26 @@ public TCreatePartitionResult 
createPartition(TCreatePartitionRequest request) t
                 tPartition.setNumBuckets(index.getTablets().size());
             }
             
tPartition.setIsMutable(olapTable.getPartitionInfo().getIsMutable(partition.getId()));
+            if (partition.getDistributionInfo().getType() == 
DistributionInfo.DistributionInfoType.RANDOM) {
+                try {
+                    int tabletIndex = 
Env.getCurrentEnv().getTabletLoadIndexRecorderMgr()
+                            .getCurrentTabletLoadIndex(dbId, 
olapTable.getId(), partition);
+                    tPartition.setLoadTabletIdx(tabletIndex);

Review Comment:
   This runtime path allocates `load_tablet_idx` with 
`getCurrentTabletLoadIndex()`, which advances the shared per-partition counter 
every time a BE asks FE to create the same auto partition. In an adaptive 
multi-BE load, BE1 can create/cache partition P and replan from base bucket N, 
while BE2 later hits the cache for the same P and replan from base bucket N+1. 
Since `assignAdaptiveBucketToPartition()` computes the whole sink assignment 
from that base index and returns only the current BE's slice, the senders no 
longer share the same load-wide bucket plan for this runtime partition. The 
mirrored `replacePartition()` code has the same issue. Please make the runtime 
partition base index stable for the load/txn/partition, for example by caching 
the chosen index with the auto-partition cache/result, instead of consuming a 
new index per receiver RPC.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to