[ 
https://issues.apache.org/jira/browse/RATIS-2313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17987031#comment-17987031
 ] 

Tsz-wo Sze commented on RATIS-2313:
-----------------------------------

LeaderReady means that the leader is able to commit a new transaction. Ratis 
should not care about how the StateMachine applies the transactions.  

Also, some StateMachines may not want to wait for its pending StateMachine 
futures since it will slow down the changing leader process.  If a StateMachine 
want to wait, it could wait for its pending StateMachine futures when getting 
the notification.

I understand that this was to fix a race condition bug from HDDS-12596.  Before 
HDDS-12596, Ozone does not need it.  We should not change the behavior of all 
the StateMachines for just one type of StateMachines.

Just an analogy, if there is a StateMachine needs to wait for a minute (for 
fixing an internal race condition), we should not add a minute sleep to ratis.

> Wait for pending StateMachine futures to complete before marking the leader 
> as ready
> ------------------------------------------------------------------------------------
>
>                 Key: RATIS-2313
>                 URL: https://issues.apache.org/jira/browse/RATIS-2313
>             Project: Ratis
>          Issue Type: Bug
>          Components: server
>            Reporter: Nandakumar
>            Assignee: Nandakumar
>            Priority: Major
>
> During leader election we don't wait for the pending StateMachine futures to 
> complete before making the leader ready. 
> This creates condition where the StateMachine might think that all the 
> pending transactions from Raft Log are applied to the StateMachine as the 
> leader is marked as ready, but the statemachine futures are not yet completed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to