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


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudTabletRebalancer.java:
##########
@@ -1029,24 +1035,62 @@ boolean staleRouteSweepNeeded(Set<Long> currentBes) {
         // baseline. Advancing only after a sweep would leave the baseline at 
the pre-addition set, and
         // dropping that same backend later would compare equal to it and go 
unnoticed.
         lastSweptBackends = currentBes;
-        if (pendingSweepRounds > 0) {
+        // Outside the configured window, leave pendingSweepRounds untouched 
rather than draining it: a
+        // backend that goes away outside the window must still get its two 
rounds once the window
+        // opens, not lose them to rounds that never actually swept.
+        if (pendingSweepRounds > 0 && isStaleRouteCleanTimeAllowed()) {
             pendingSweepRounds--;
             return true;
         }
         return false;
     }
 
+    /**
+     * Whether the configured cleanup window 
(cloud_tablet_rebalancer_stale_route_clean_start_time to
+     * ..._end_time) contains the current time. Equal start/end -- including 
the "00:00"/"00:00" default --
+     * means unrestricted, matching the pre-existing behavior of sweeping 
whenever staleRouteSweepNeeded()
+     * says a sweep is due. An unparseable configuration also falls back to 
unrestricted rather than
+     * silently disabling cleanup.
+     */
+    @VisibleForTesting
+    boolean isStaleRouteCleanTimeAllowed() {
+        LocalTime start = 
parseCleanTime(Config.cloud_tablet_rebalancer_stale_route_clean_start_time);
+        LocalTime end = 
parseCleanTime(Config.cloud_tablet_rebalancer_stale_route_clean_end_time);

Review Comment:
   ignore



##########
fe/fe-core/src/main/java/org/apache/doris/master/Checkpoint.java:
##########
@@ -159,6 +161,13 @@ public synchronized void doCheckpoint() throws 
CheckpointException {
             }
             env.postProcessAfterMetadataReplayed(false);
             postProcessCloudMetadata();
+            try {
+                removeInvalidCloudReplicaRoutes(env);
+            } catch (Exception e) {

Review Comment:
   ignore



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