Skip to content

Commit e3abd3f

Browse files
committed
Supported transition from leader to standby according to #224
1 parent 91af5db commit e3abd3f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/DotNext.Tests/Net/Cluster/Consensus/Raft/Http/RaftHttpClusterTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ public static async Task StandbyMode()
448448
await GetLocalClusterView(host3).Readiness.WaitAsync(DefaultTimeout);
449449

450450
// suspend two nodes
451-
False(await GetLocalClusterView(host1).EnableStandbyModeAsync());
452451
True(await GetLocalClusterView(host2).EnableStandbyModeAsync());
453452
True(GetLocalClusterView(host2).Standby);
454453
True(await GetLocalClusterView(host3).EnableStandbyModeAsync());

src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/RaftCluster.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ public async ValueTask<bool> EnableStandbyModeAsync(CancellationToken token = de
388388
ObjectDisposedException.ThrowIf(IsDisposed, this);
389389

390390
RaftState<TMember> currentState;
391-
if ((currentState = state) is FollowerState<TMember> or CandidateState<TMember>)
391+
if ((currentState = state) is not StandbyState<TMember>)
392392
{
393393
var tokenSource = token.LinkTo(LifecycleToken);
394394
var lockTaken = false;

0 commit comments

Comments
 (0)