金庆的专栏

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  418 随笔 :: 0 文章 :: 454 评论 :: 0 Trackbacks
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();
        }
posted on 2021-12-08 09:43 金庆 阅读(75) 评论(0)  编辑 收藏 引用 所属分类: 9. 其它

只有注册用户登录后才能发表评论。
【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理