feat: add stream replica groups and leader stepdown
This commit is contained in:
@@ -9,6 +9,7 @@ public sealed class RaftNode
|
||||
|
||||
public string Id { get; }
|
||||
public int Term => TermState.CurrentTerm;
|
||||
public bool IsLeader => Role == RaftRole.Leader;
|
||||
public RaftRole Role { get; private set; } = RaftRole.Follower;
|
||||
public RaftTermState TermState { get; } = new();
|
||||
public long AppliedIndex { get; set; }
|
||||
@@ -99,6 +100,8 @@ public sealed class RaftNode
|
||||
public void RequestStepDown()
|
||||
{
|
||||
Role = RaftRole.Follower;
|
||||
_votesReceived = 0;
|
||||
TermState.VotedFor = null;
|
||||
}
|
||||
|
||||
private void TryBecomeLeader(int clusterSize)
|
||||
|
||||
Reference in New Issue
Block a user