DeathVoteExpirationTimeout in Orleans

Posted 金庆

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DeathVoteExpirationTimeout in Orleans相关的知识,希望对你有一定的参考价值。

DeathVoteExpirationTimeout in Orleans

(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();
        

以上是关于DeathVoteExpirationTimeout in Orleans的主要内容,如果未能解决你的问题,请参考以下文章