Mikhail Efremov created IGNITE-23753:
----------------------------------------
Summary: Replica's state doesn't change on node stopping
Key: IGNITE-23753
URL: https://issues.apache.org/jira/browse/IGNITE-23753
Project: Ignite
Issue Type: Bug
Reporter: Mikhail Efremov
Assignee: Mikhail Efremov
*Description*
There is a possible situation while an Ignite node was being stopped
{{TableManager}} desroyed all partitions and replicas already, but
{{ReplicaManager}} isn't even took a busy lock and e.g. {{ReplicaStateManager}}
after IGNITE-22036 may attemts to get already removed replica future. For now
we may ignore such {{null}} value, but it's clear that the picture is wrong: we
already deleted a replica, but it's state isn't {{STOPPED}}.
Also we may found a spagetti-like method calls between {{TableManager}} and
{{ReplicaManager}} on a replica's stopping process: {{TableManager}} calls
{{ReplicaManager#weakReplicaStop}} that call the given lambda that actually
{{TableManager#stopAndDestroyPartition}} that at the end calls
{{ReplicaManager#stopReplicaInternal}}. Probably we should separate this code.
*Motivation*
In the future we may have a logic that get replicas and we might get an
unconsistent replica's state on a node's stopping process.
*Definition of Done*
* New {{WeakStopReason.SHUTDOWN}} is added and is used for node stopping
situation in {{TableManager}}.
* In case of {{SHUTDOWN}} reason we must set {{STOPPED}} replica state and stop
the replica immediately.
* (optional) Consider an opportunity to refactor
{{TableManager#stopAndDestroyPartition}} in a looser couple way.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)