oss-taishan-ai commented on issue #10416:
URL: https://github.com/apache/rocketmq/issues/10416#issuecomment-4620092726

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Not a Bug**
   
   Thank you for the detailed report. After verifying the source code, the 
logic appears to be correct.
   
   **Analysis:** The condition at `RaftBrokerHeartBeatManager.java:191-195`:
   ```java
   if (this.firstReceivedHeartbeatTime == -1 ||
       this.firstReceivedHeartbeatTime + jRaftScanWaitTimeoutMs > 
System.currentTimeMillis()) {
       return; // skip
   }
   ```
   
   - When `now - firstReceivedHeartbeatTime < waitTimeout` → condition is 
**true** → `return` (skip scanning, within grace window)
   - When `now - firstReceivedHeartbeatTime >= waitTimeout` → condition is 
**false** → method **proceeds** to evict inactive brokers
   
   This is a startup grace window (default 1000ms) to avoid premature eviction 
after controller cluster restart. After the window elapses, scanning and 
eviction work correctly.
   
   **Reference:** Unit test `testScanNotActiveBrokerSuccess` in 
`RaftBrokerHeartBeatManagerTest` exercises the post-window path and confirms 
eviction works as designed.
   
   ---
   *Automated evaluation by github-manager-bot*
   


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

Reply via email to