(Jin Qing’s Column, Dec., 2021)
Try to find out why Orleans need a DeathVoteExpirationTimeout config.
https://dotnet.github.io/orleans/docs/implementation/cluster_management.html#extension-to-totally-order-membership-views
DeathVoteExpirationTimeout - Expiration time in seconds for death vote in the membership table. Default is 120 seconds
GetFreshVotes
DeathVoteExpirationTimeout is only used by GetFreshVotes(), which has 3 occurence:
class ClusterHealthMonitor
{
...
private UpdateMonitoredSilos(...)
{
...
bool isSuspected = candidateEntry.GetFreshVotes(now, DeathVoteExpirationTimeout).Count > 0;
...
}
}
class LocalSiloHealthMonitor
{
...
private int CheckSuspectingNodes(DateTime now, List<string> complaints)
{
...
var freshVotes = membershipEntry.GetFreshVotes(now, DeathVoteExpirationTimeout);
...
}
...
}
class MembershipTableManager
{
...
public TryToSuspectOrKill(SiloAddress silo)
{
...
// get all valid (non-expired) votes
var freshVotes = entry.GetFreshVotes(DateTime.UtcNow, DeathVoteExpirationTimeout);
...
}
...
}
GetFreshVotes() uses this expiration time to ignore old voter:
internal GetFreshVotes(DateTime now, TimeSpan expiration)
{
...
foreach (var voter in this.SuspectTimes)
{
var otherVoterTime = voter.Item2;
if (now.Subtract(otherVoterTime) < expiration)
{
result.Add(voter);
}
}
return result.ToImmutable();
}