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


##########
fe/fe-core/src/main/java/org/apache/doris/system/Backend.java:
##########
@@ -886,7 +899,14 @@ public String toString() {
      * return true if any port changed, or alive state is changed.
      */
     public boolean handleHbResponse(BackendHbResponse hbResponse, boolean 
isReplay) {
-        boolean isChanged = false;
+        FileEncryptionCapability previousCapability = fileEncryptionCapability;
+        fileEncryptionCapability = hbResponse.getStatus() == HbStatus.OK
+                && hbResponse.getNativeFileEncryptionVersion() > 0
+                ? new 
FileEncryptionCapability(hbResponse.getNativeFileEncryptionVersion(), 
hbResponse.getHbTime())
+                : null;
+        // Positive leases must reach followers every round. Missing/failed 
heartbeats must revoke them
+        // immediately, even while the usual liveness grace still considers 
the backend alive.
+        boolean isChanged = previousCapability != null || 
fileEncryptionCapability != null;

Review Comment:
   [P2] Preserve liveness grace when broadcasting capability revocation
   
   With `max_backend_heartbeat_failure_tolerance_count > 1`, the first failed 
heartbeat after a capable success now returns `isChanged=true` here even though 
the leader keeps the BE alive. `HeartbeatMgr` journals that failed response, 
and followers replay it with `isReplay=true`; the existing failure branch then 
marks the BE dead immediately. Follower/observer queries therefore lose a 
healthy backend (or fail with no available backends) until the next successful 
heartbeat, defeating the configured failure tolerance. Propagate capability 
revocation without replaying a premature liveness transition, and cover the 
leader/follower sequence with a tolerance above one.



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