[ 
https://issues.apache.org/jira/browse/IGNITE-25814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roman Puchkovskiy updated IGNITE-25814:
---------------------------------------
    Description: 
Currently, ReplicaManager#startReplicaInternal() starts a Raft node and only 
then registers the replica future in the map of replicas. As a result, Raft 
leader election listener might get a notification before the replica is 
registered, so it will get null when attempting to get the corresponding 
Replica instance.

The map contains futures, but it seems that they are only used to solve the 
race between requests to the replica and its registration. We can leverage the 
futures and do the following:
 # Do a compute on the map, as it's done now, but, in case the future was not 
present in the map, just create a new future
 # Initiate Raft node start in the replicaStartStopExecutor and complete the 
future when the Raft node is started
 # Return the future to the caller meanwhile

> Start partition Raft node after registering replica future
> ----------------------------------------------------------
>
>                 Key: IGNITE-25814
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25814
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Roman Puchkovskiy
>            Priority: Major
>              Labels: ignite-3
>
> Currently, ReplicaManager#startReplicaInternal() starts a Raft node and only 
> then registers the replica future in the map of replicas. As a result, Raft 
> leader election listener might get a notification before the replica is 
> registered, so it will get null when attempting to get the corresponding 
> Replica instance.
> The map contains futures, but it seems that they are only used to solve the 
> race between requests to the replica and its registration. We can leverage 
> the futures and do the following:
>  # Do a compute on the map, as it's done now, but, in case the future was not 
> present in the map, just create a new future
>  # Initiate Raft node start in the replicaStartStopExecutor and complete the 
> future when the Raft node is started
>  # Return the future to the caller meanwhile



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

Reply via email to