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


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudTabletRebalancer.java:
##########
@@ -1302,16 +1266,39 @@ private void 
handleWarmupBatchFailure(List<WarmupTabletTask> tasks, Exception e)
     }
 
     private void revertWarmupState(WarmupTabletTask task) {
-        updateBeToTablets(task.pickedTabletId, task.destBe, task.srcBe,
-                futureBeToTabletsGlobal, futureBeToTabletsInTable, 
futurePartitionToTablets);
-        tabletToInfightTask.remove(new InfightTablet(task.pickedTabletId, 
task.clusterId));
+        InfightTablet key = new InfightTablet(task.pickedTabletId, 
task.clusterId);
+        InfightTask inflight = tabletToInfightTask.get(key);
+        if (inflight == null || inflight.srcBe != task.srcBe || 
inflight.destBe != task.destBe
+                || !tabletToInfightTask.remove(key, inflight)) {

Review Comment:
   [P2] Serialize rollback with already-started warmup completion
   
   Removing the task here does not revoke a checker that already obtained its 
`InfightTask` at lines 923-925: `handleWarmupCompletion` can still publish its 
destination at line 1850 after this rollback restores GLOBAL to the old 
primary. For example, a warmup RPC accepted by B can time out at FE while the 
checker reports it done. Pause that checker before publication, drain the 
failure here, then resume it before the live partition/table views are built.
   
   With healthy A/B/C, let the first seven-tablet table have CURRENT `(4,1,2)` 
and FUTURE `(3,2,2)` through one A-to-B task, and a second single-index table 
have `(2,3,2)`. Rollback leaves GLOBAL `(6,4,4)`; the held completion makes the 
actual tables `(3,2,2)` and `(2,3,2)`, so both live phases skip. GLOBAL can 
then pick the raced tablet from A for A-to-C: fresh index/table counts allow 
`A=3 > C=2`, although the tablet is actually at B. Its index becomes `(3,1,3)`. 
The old retained partition graph saw `(4,1,2)`, scheduled partition correction, 
and gated GLOBAL.
   
   This is a separate post-snapshot rollback producer from the fixed 
primary/task lookup threads. Coordinate task ownership and primary publication 
between completion and rollback (or process both on the daemon), and add a 
latch test for this held-callback interleaving.



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