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


##########
fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java:
##########
@@ -217,9 +218,13 @@ private boolean handleHbResponse(HeartbeatResponse 
response, boolean isReplay) {
                     } else {
                         // invalid all connections cached in ClientPool
                         ClientPool.backendPool.clearPool(new 
TNetworkAddress(be.getHost(), be.getBePort()));
-                        if (!isReplay && System.currentTimeMillis() - 
be.getLastUpdateMs()
-                                >= 
Config.abort_txn_after_lost_heartbeat_time_second * 1000L
-                                && be.getLastUpdateMs() > 0) {
+                        long lostTimeMs = System.currentTimeMillis() - 
be.getLastUpdateMs();
+                        long timeoutMs = 
Config.abort_txn_after_lost_heartbeat_time_second * 1000L;
+                        boolean nonNormalCloudCluster = Config.isCloudMode()
+                                && 
!ClusterStatus.NORMAL.name().equals(be.getCloudClusterStatus());
+                        // Bound repeated MS scans for inactive clusters to 
[timeoutMs, 2 * timeoutMs).
+                        if (!isReplay && be.getLastUpdateMs() > 0 && 
lostTimeMs >= timeoutMs
+                                && (!nonNormalCloudCluster || lostTimeMs < 2 * 
timeoutMs)) {

Review Comment:
   This change intentionally provides a bounded best-effort cleanup window for 
non-normal clusters. With the default 300-second timeout and 10-second 
heartbeat interval, the window contains about 30 heartbeat attempts. Missing 
cleanup after failover is acceptable because MS transaction timeout remains the 
fallback. Persisting per-outage submission state is outside the scope of this 
minimal fix.



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