// Token: 0x0600004D RID: 77 RVA: 0x00002C20 File Offset: 0x00000E20
        protected AmMultiNodeMdbStatusFetcher StartMdbStatusFetcher()
        {
            AmMultiNodeMdbStatusFetcher amMultiNodeMdbStatusFetcher = new AmMultiNodeMdbStatusFetcher();

            ThreadPoolThreadCountHelper.IncreaseForServerOperations(this.m_amConfig);
            amMultiNodeMdbStatusFetcher.Start(this.m_amConfig, new Func <List <AmServerName> >(this.GetServers));
            return(amMultiNodeMdbStatusFetcher);
        }
        // Token: 0x060003C1 RID: 961 RVA: 0x0001464C File Offset: 0x0001284C
        private void Initialize(AmConfig cfg, List <AmServerName> serverList, bool isBasicInformation)
        {
            Dictionary <AmServerName, AmMdbStatusServerInfo> multiNodeServerInfo = AmMultiNodeMdbStatusFetcher.GetMultiNodeServerInfo(cfg, serverList);
            List <AmServerName> nodeList = multiNodeServerInfo.Keys.ToList <AmServerName>();

            base.Initialize(nodeList);
            this.ServerInfoMap        = multiNodeServerInfo;
            this.m_isBasicInformation = isBasicInformation;
            this.MdbStatusMap         = new Dictionary <AmServerName, MdbStatus[]>(this.m_expectedCount);
        }
Пример #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");
                    }
                }
            }
        }
        // Token: 0x0600005A RID: 90 RVA: 0x00002DD0 File Offset: 0x00000FD0
        protected void RunInternalCommon()
        {
            AmMultiNodeMdbStatusFetcher     amMultiNodeMdbStatusFetcher = base.StartMdbStatusFetcher();
            Dictionary <Guid, DatabaseInfo> dbMap = this.GenerateDatabaseInfoMap();

            amMultiNodeMdbStatusFetcher.WaitUntilStatusIsReady();
            Dictionary <AmServerName, MdbStatus[]> mdbStatusMap = amMultiNodeMdbStatusFetcher.MdbStatusMap;

            if (mdbStatusMap == null)
            {
                ReplayEventLogConstants.Tuple_PeriodicOperationFailedRetrievingStatuses.LogEvent(null, new object[]
                {
                    "AmStartupAutoMounter"
                });
                return;
            }
            this.MergeDatabaseInfoWithMdbStatus(dbMap, mdbStatusMap, amMultiNodeMdbStatusFetcher.ServerInfoMap);
            this.PopulateWithDatabaseOperations(dbMap);
            this.EnqueueGeneratedOperations(dbMap);
        }
        // Token: 0x06000093 RID: 147 RVA: 0x00004B2C File Offset: 0x00002D2C
        protected override void RunInternal()
        {
            IADDatabase[] dbList = null;
            if (!this.m_isForce)
            {
                AmMultiNodeMdbStatusFetcher amMultiNodeMdbStatusFetcher = base.StartMdbStatusFetcher();
                IADDatabase[] databases = base.GetDatabases();
                amMultiNodeMdbStatusFetcher.WaitUntilStatusIsReady();
                Dictionary <AmServerName, MdbStatus[]> mdbStatusMap = amMultiNodeMdbStatusFetcher.MdbStatusMap;
                AmMdbStatusServerInfo amMdbStatusServerInfo         = amMultiNodeMdbStatusFetcher.ServerInfoMap[this.m_nodeName];
                MdbStatus[]           mdbStatuses = mdbStatusMap[this.m_nodeName];
                if (amMdbStatusServerInfo.IsReplayRunning)
                {
                    if (!this.skipIfReplayRunning)
                    {
                        if (RegistryParameters.TransientFailoverSuppressionDelayInSec > 0)
                        {
                            dbList = this.GetDatabasesToBeMoved(databases, mdbStatuses);
                            base.AddDelayedFailoverEntryAsync(this.m_nodeName, this.m_reasonCode);
                        }
                    }
                    else
                    {
                        ReplayCrimsonEvents.FailoverOnReplDownSkipped.Log <AmServerName, string, string>(this.m_nodeName, "ReplRunning", "MoveAll");
                    }
                }
                else
                {
                    dbList = databases;
                }
            }
            else
            {
                dbList = base.GetDatabases();
            }
            AmDbActionCode actionCode = new AmDbActionCode(AmDbActionInitiator.Automatic, this.m_reasonCode, AmDbActionCategory.Move);

            base.MoveDatabases(actionCode, dbList);
        }
Пример #6
0
        protected override void RunInternal()
        {
            AmMultiNodeMdbStatusFetcher     amMultiNodeMdbStatusFetcher = base.StartMdbStatusFetcher();
            Dictionary <Guid, DatabaseInfo> dbMap = base.GenerateDatabaseInfoMap();

            amMultiNodeMdbStatusFetcher.WaitUntilStatusIsReady();
            Dictionary <AmServerName, MdbStatus[]> mdbStatusMap = amMultiNodeMdbStatusFetcher.MdbStatusMap;

            if (mdbStatusMap == null)
            {
                ReplayEventLogConstants.Tuple_PeriodicOperationFailedRetrievingStatuses.LogEvent(null, new object[]
                {
                    "AmPeriodicDatabaseStateAnalyzer"
                });
                return;
            }
            base.MergeDatabaseInfoWithMdbStatus(dbMap, mdbStatusMap, amMultiNodeMdbStatusFetcher.ServerInfoMap);
            Dictionary <Guid, DatabaseInfo> filteredMap = this.FilterDatabasesNeedingAction(dbMap);

            this.DeferDatabaseActionsIfRequired(filteredMap);
            this.InitiateSystemFailoverIfReplayUnreachable(amMultiNodeMdbStatusFetcher, dbMap);
        }