diff --git a/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/LeaderState.cs b/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/LeaderState.cs index 81abd5c43..12677b3ff 100644 --- a/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/LeaderState.cs +++ b/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/LeaderState.cs @@ -163,15 +163,14 @@ private async Task DoHeartbeats(TimeSpan period, IAuditTrail audi goto case MemberResponse.Canceled; case MemberResponse.Canceled: return; + case MemberResponse.Successful when ++quorum == majority: + RenewLease(startTime.Elapsed); + UpdateLeaderStickiness(); + goto default; + default: + commitQuorum += Unsafe.BitCast(result.Value); + continue; } - - if (++quorum == majority) - { - RenewLease(startTime.Elapsed); - UpdateLeaderStickiness(); - } - - commitQuorum += Unsafe.BitCast(result.Value); } }