zuston opened a new pull request, #3647:
URL: https://github.com/apache/fluss/pull/3647

   ### Purpose
   
   Linked issue: close #3646
   
   `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.
   
   ### Brief change log
   
   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.
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


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