ignite-3 icon indicating copy to clipboard operation
ignite-3 copied to clipboard

IGNITE-22315 Make raft-client starting only once and only with raft-client and replica together

Open JAkutenshi opened this issue 8 months ago • 0 comments

JIRA Ticket: IGNITE-22315 | Make raft-client starting only once and only with raft-client and replica together

The goal

The goal of the ticket is to remove excessive raft-clients starting.

The reason

If a local node is in assignments, then and only then we should start a whole replication group, that consists of raft-node, raft-client and replica itself. Every entity is a single copy per group and neither should be started outside of the group. Before this ticket every partition started a raft-client.

The solution

  1. Related completion stage that create raft-client is removed.
  2. Tests are adjusted for such behavior and check that raft-clients started and updated only on replication group and only.
  3. ReplicaManager#startReplica chains all raft-entities starting together with replica starting to a common future.
  4. Replica manager now handle with replicas starting executor. The motivation do not grab it from table manager is better control of the lifecycle: the executor starts inside replica manager and there is terminated.
  5. TableManager#startPartitionAndStartClient is refactored due to simplicity of the code.

Abandoned PR due to unstable tests flaking is closed

JAkutenshi avatar Jun 19 '24 16:06 JAkutenshi