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

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and 
found nothing similar.
   
   
   ### Motivation
   
   ### Background
   
   `NotifyLeaderAndIsr` is currently processed on the RPC worker thread. The 
underlying `becomeLeaderOrFollower` operation may perform relatively expensive 
replica state transitions, such as initializing local replicas and updating 
replica fetchers. A slow transition can therefore occupy an RPC worker thread 
and delay unrelated RPC requests.
   
   ### Solution
   
   Introduce a dedicated single-thread executor for `NotifyLeaderAndIsr` 
operations.
   The executor is created and managed by `TabletServer` , injected into 
`TabletService` , and gracefully shut down before replica-related resources are 
closed. `TabletService` parses the request on the RPC worker thread and submits 
the replica state transition to the dedicated executor.
   A single thread is sufficient because replica state changes are already 
serialized by the replica state change lock. It also preserves the execution 
order of `NotifyLeaderAndIsr` requests while preventing slow transitions from 
blocking other RPCs.
   The RPC semantics remain unchanged: the response future is completed only 
after `becomeLeaderOrFollower` finishes.
   
   ### Solution
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Willingness to contribute
   
   - [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