platinumhamburg opened a new issue, #2162:
URL: https://github.com/apache/fluss/issues/2162

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and 
found nothing similar.
   
   
   ### Fluss version
   
   0.8.0 (latest release)
   
   ### Please describe the bug 🐞
   
   When the ISR (In-Sync Replicas) shrinks to a single replica, the current 
implementation will set the leader to NO_LEADER if that replica goes offline. 
This creates an issue: since ISR expansion requires a leader to process 
expansion requests, setting the leader—which is the sole member of the ISR—to 
NO_LEADER is meaningless. As the only replica in the ISR, it must be started in 
Leader Replica mode to drive the bucket state back to normal state.
   
   ### Solution
   
   When ISR contains only one replica (endangered ISR), preserve the current 
leader even if that replica goes offline temporarily. The key changes:
   
   1. Detect endangered ISR state: `isEndangeredIsr = 
(leaderAndIsr.isr().size() == 1)`
   2. Keep the last replica in ISR to maintain leader election capability
   3. Only set leader to `NO_LEADER` when ISR is not endangered
   4. Allow the original replica to resume as leader and process ISR expansion 
requests when it recovers
   
   This ensures the bucket can recover to normal state when replicas come back 
online, as the preserved leader can handle ISR expansion requests.
   
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


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