예제 #1
0
        // Token: 0x0600054E RID: 1358 RVA: 0x0001AF88 File Offset: 0x00019188
        protected override void TimerCallbackInternal()
        {
            bool      flag = true;
            Exception ex   = null;
            AmSystemFailoverOnReplayDownTracker failoverTracker = AmSystemManager.Instance.SystemFailoverOnReplayDownTracker;

            if (failoverTracker != null)
            {
                try
                {
                    ex = AmHelper.HandleKnownExceptions(delegate(object param0, EventArgs param1)
                    {
                        this.Run(failoverTracker);
                    });
                    flag = false;
                }
                finally
                {
                    failoverTracker.RemoveTimer(this.serverName);
                    if (flag || ex != null)
                    {
                        ReplayCrimsonEvents.FailoverOnReplDownFailedToInitiate.Log <AmServerName, string>(this.serverName, (ex != null) ? ex.Message : "<Unhandled exception>");
                    }
                }
            }
        }
예제 #2
0
        // Token: 0x0600054F RID: 1359 RVA: 0x0001B024 File Offset: 0x00019224
        private void Run(AmSystemFailoverOnReplayDownTracker failoverTracker)
        {
            AmConfig config = AmSystemManager.Instance.Config;

            if (!config.IsPAM)
            {
                ReplayCrimsonEvents.FailoverOnReplDownSkipped.Log <AmServerName, string, string>(this.serverName, "RoleNotPAM", "TimerCallback");
                return;
            }
            if (AmHelper.IsReplayRunning(this.serverName))
            {
                ReplayCrimsonEvents.FailoverOnReplDownSkipped.Log <AmServerName, string, string>(this.serverName, "ReplRunning", "TimerCallback");
                return;
            }
            AmThrottledActionTracker <FailoverData> .ThrottlingShapshot throttlingSnapshot = failoverTracker.GetThrottlingSnapshot(this.serverName);
            if (throttlingSnapshot.IsActionCalledTooSoonPerNode || throttlingSnapshot.IsActionCalledTooSoonAcrossDag || throttlingSnapshot.IsMaxActionsPerNodeExceeded || throttlingSnapshot.IsMaxActionsAcrossDagExceeded)
            {
                throttlingSnapshot.LogResults(ReplayCrimsonEvents.FailoverOnReplDownThrottlingFailed, TimeSpan.FromMinutes(15.0));
                return;
            }
            failoverTracker.AddFailoverEntry(this.serverName);
            throttlingSnapshot.LogResults(ReplayCrimsonEvents.FailoverOnReplDownThrottlingSucceeded, TimeSpan.Zero);
            AmEvtSystemFailoverOnReplayDown amEvtSystemFailoverOnReplayDown = new AmEvtSystemFailoverOnReplayDown(this.serverName);

            amEvtSystemFailoverOnReplayDown.Notify();
        }
예제 #3
0
        protected void InitiateSystemFailoverIfReplayUnreachable(AmMultiNodeMdbStatusFetcher mdbStatusFetcher, Dictionary <Guid, DatabaseInfo> dbMap)
        {
            AmRole role = AmSystemManager.Instance.Config.Role;

            if (role != AmRole.PAM)
            {
                return;
            }
            if (!RegistryParameters.OnReplDownFailoverEnabled)
            {
                ReplayCrimsonEvents.FailoverOnReplDownDisabledInRegistry.LogPeriodic(Environment.MachineName, TimeSpan.FromHours(1.0));
                return;
            }
            AmSystemFailoverOnReplayDownTracker systemFailoverOnReplayDownTracker = AmSystemManager.Instance.SystemFailoverOnReplayDownTracker;

            if (systemFailoverOnReplayDownTracker == null)
            {
                ReplayCrimsonEvents.FailoverOnReplDownFailoverTrackerNotInitialized.LogPeriodic(Environment.MachineName, TimeSpan.FromHours(1.0));
                return;
            }
            foreach (KeyValuePair <AmServerName, AmMdbStatusServerInfo> keyValuePair in mdbStatusFetcher.ServerInfoMap)
            {
                AmServerName          key   = keyValuePair.Key;
                AmMdbStatusServerInfo value = keyValuePair.Value;
                if (value.IsReplayRunning)
                {
                    systemFailoverOnReplayDownTracker.MarkReplayUp(key);
                }
                else if (value.IsStoreRunning)
                {
                    systemFailoverOnReplayDownTracker.MarkReplayDown(key, false);
                    int activeDatabaseCountOnServer = this.GetActiveDatabaseCountOnServer(dbMap, key);
                    if (activeDatabaseCountOnServer > 0)
                    {
                        systemFailoverOnReplayDownTracker.ScheduleFailover(key);
                    }
                    else
                    {
                        ReplayCrimsonEvents.FailoverOnReplDownSkipped.LogPeriodic <AmServerName, string, string>(key, TimeSpan.FromDays(1.0), key, "NoActives", "Periodic");
                    }
                }
            }
        }