deardeng commented on code in PR #66984:
URL: https://github.com/apache/doris/pull/66984#discussion_r3838689733


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudTabletRebalancer.java:
##########
@@ -1003,9 +1006,47 @@ public void checkDecommissionState(Map<String, 
List<Long>> clusterToBes) {
         }
     }
 
+    /**
+     * Decides whether this round sweeps stale routes, and advances the 
backend baseline. Call once per
+     * round. Without this gate the sweep would walk every replica's route 
maps once a second under
+     * table.readLock() only to find nothing, which on a large catalog is pure 
allocation.
+     */
+    @VisibleForTesting
+    boolean staleRouteSweepNeeded(Set<Long> currentBes) {
+        if (!Config.enable_cloud_replica_stale_route_clean) {
+            lastSweptBackends = null;
+            pendingSweepRounds = 0;
+            return false;
+        }
+        if (lastSweptBackends == null || 
!currentBes.containsAll(lastSweptBackends)) {
+            // Only a backend that went away can strand a route. Two rounds 
rather than one: a query

Review Comment:
   fixed
   



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