Example #1
0
 // Token: 0x06001F4A RID: 8010 RVA: 0x0008DDD8 File Offset: 0x0008BFD8
 public ReplaySystemRunConfigurationUpdaterSingleConfig(ReplicaInstanceManager riManager, Guid dbGuid, ReplayConfigChangeHints changeHint) : base(riManager, dbGuid)
 {
     this.WaitForCompletion = false;
     this.IsHighPriority    = false;
     this.ForceRestart      = false;
     this.ChangeHint        = changeHint;
 }
        // Token: 0x06001EF2 RID: 7922 RVA: 0x0008BFF0 File Offset: 0x0008A1F0
        private int GetLocalCopyCount()
        {
            int result = 0;
            ReplicaInstanceManager replicaInstanceManager = Dependencies.ReplayCoreManager.ReplicaInstanceManager;

            if (replicaInstanceManager != null)
            {
                result = replicaInstanceManager.GetRICount();
            }
            return(result);
        }
Example #3
0
        public void TriggerTruncation(Guid dbGuid)
        {
            ReplicaInstanceManager replicaInstanceManager = Dependencies.ReplayCoreManager.ReplicaInstanceManager;
            ReplicaInstance        replicaInstance;

            if (replicaInstanceManager.TryGetReplicaInstance(dbGuid, out replicaInstance))
            {
                LogTruncater component = replicaInstance.GetComponent <LogTruncater>();
                component.TimerCallback(null);
                return;
            }
            throw new ArgumentException("Unable to find a ReplicaInstance with a DB Guid of " + dbGuid, "dbGuid");
        }
 private void DismountForSourceLogCorruption(Exception corruptionEx)
 {
     ReplayEventLogConstants.Tuple_CorruptLogRecoveryIsImmediatelyAttempted.LogEvent(null, new object[]
     {
         this.DatabaseCopyName,
         corruptionEx.Message
     });
     try
     {
         ReplicaInstanceManager replicaInstanceManager = Dependencies.ReplayCoreManager.ReplicaInstanceManager;
         int    num;
         string text = ReplayEventLogConstants.Tuple_CorruptLogRecoveryIsImmediatelyAttempted.EventLogToString(out num, new object[]
         {
             this.DatabaseCopyName,
             corruptionEx.Message
         });
         uint eventViewerEventId = DiagCore.GetEventViewerEventId(ReplayEventLogConstants.Tuple_CorruptLogRecoveryIsImmediatelyAttempted);
         replicaInstanceManager.RequestSuspendAndFail(this.DatabaseGuid, eventViewerEventId, text, text, false, false, false, false);
         MonitoredDatabase.Tracer.TraceDebug((long)this.GetHashCode(), "DismountForSourceLogCorruption successfully suspended");
     }
     catch (TaskServerException ex)
     {
         MonitoredDatabase.Tracer.TraceError <TaskServerException>((long)this.GetHashCode(), "DismountForSourceLogCorruption failed to suspend: {0}", ex);
         ReplayEventLogConstants.Tuple_CorruptLogRecoveryFailedToSuspend.LogEvent(null, new object[]
         {
             this.DatabaseName,
             ex.Message
         });
     }
     finally
     {
         Exception ex2 = this.TryToDismountClean();
         if (ex2 != null)
         {
             ReplayEventLogConstants.Tuple_CorruptLogRecoveryFailedToDismount.LogEvent(null, new object[]
             {
                 this.DatabaseName,
                 ex2.Message
             });
         }
     }
 }
Example #5
0
        public LogCopier FindLogCopier(string nodeName, Guid dbGuid)
        {
            ReplicaInstanceManager replicaInstanceManager = Dependencies.ReplayCoreManager.ReplicaInstanceManager;
            ReplicaInstance        replicaInstance        = null;
            LogCopier logCopier = null;

            if (replicaInstanceManager.TryGetReplicaInstance(dbGuid, out replicaInstance))
            {
                logCopier = replicaInstance.GetComponent <LogCopier>();
                if (logCopier == null)
                {
                    ComponentFinder.Tracer.TraceError <Guid>(0L, "FindLogCopier failed to find LogCopier for database {0}", dbGuid);
                }
            }
            else
            {
                ComponentFinder.Tracer.TraceError <Guid>(0L, "FindLogCopier failed to find RI database {0}", dbGuid);
            }
            return(logCopier);
        }
Example #6
0
        internal static Exception SuspendAndFailLocalDatabaseCopy(IADDatabase database, string suspendMsg, string errorMsg, uint errorEventId, bool blockResume, bool blockReseed, bool blockInPlaceReseed)
        {
            Exception ex = null;

            try
            {
                Action invokableAction = delegate()
                {
                    ReplicaInstanceManager replicaInstanceManager = Dependencies.ReplayCoreManager.ReplicaInstanceManager;
                    replicaInstanceManager.RequestSuspendAndFail(database.Guid, errorEventId, errorMsg, suspendMsg, true, blockResume, blockReseed, blockInPlaceReseed);
                };
                InvokeWithTimeout.Invoke(invokableAction, TimeSpan.FromSeconds((double)RegistryParameters.FailureItemLocalDatabaseOperationTimeoutInSec));
            }
            catch (TimeoutException ex2)
            {
                DatabaseTasks.Trace("SuspendLocalDatabaseCopy(): Failed on timeout: {0}", new object[]
                {
                    ex2
                });
                ex = ex2;
            }
            catch (TaskServerException ex3)
            {
                ex = ex3;
            }
            catch (TaskServerTransientException ex4)
            {
                ex = ex4;
            }
            if (ex != null)
            {
                DatabaseTasks.Trace("SuspendAndFailLocalDatabaseCopy failed to suspend: {0}", new object[]
                {
                    ex
                });
                return(new DatabaseCopySuspendException(database.Name, Environment.MachineName, ex.ToString(), ex));
            }
            return(null);
        }
 public void ProcessSourceLogCorruption(long badGeneration, Exception ex)
 {
     if (Monitor.TryEnter(this.m_sourceLogCorruptionLock))
     {
         try
         {
             long num = this.EndOfLogGeneration - badGeneration;
             if (num >= (long)RegistryParameters.CorruptLogRequiredRange)
             {
                 if (badGeneration > this.m_mostRecentSourceLogCorruptionGen)
                 {
                     this.m_mostRecentSourceLogCorruptionGen = badGeneration;
                     FailureItemPublisherHelper.PublishAction(FailureTag.SourceLogCorruptionOutsideRequiredRange, this.DatabaseGuid, this.DatabaseName, null);
                 }
             }
             else
             {
                 ReplicaInstanceManager replicaInstanceManager = Dependencies.ReplayCoreManager.ReplicaInstanceManager;
                 ReplicaInstance        replicaInstance        = null;
                 if (replicaInstanceManager.TryGetReplicaInstance(this.DatabaseGuid, out replicaInstance) && replicaInstance.CurrentContext.IsBroken)
                 {
                     MonitoredDatabase.Tracer.TraceError((long)this.GetHashCode(), "ProcessSourceLogCorruption ignores error since copy is already broken");
                 }
                 else
                 {
                     this.m_mostRecentSourceLogCorruptionGen = badGeneration;
                     this.DismountForSourceLogCorruption(ex);
                     FailureItemPublisherHelper.PublishAction(FailureTag.SourceLogCorruption, this.DatabaseGuid, this.DatabaseName, null);
                 }
             }
         }
         finally
         {
             Monitor.Exit(this.m_sourceLogCorruptionLock);
         }
     }
 }
 protected ReplaySystemDatabaseQueuedItem(ReplicaInstanceManager riManager, Guid dbGuid) : base(riManager)
 {
     this.DbGuid = dbGuid;
 }
 // Token: 0x06001F39 RID: 7993 RVA: 0x0008DBA0 File Offset: 0x0008BDA0
 protected ReplaySystemQueuedItem(ReplicaInstanceManager riManager)
 {
     this.ReplicaInstanceManager = riManager;
 }
Example #10
0
        public void SetFailedAndSuspended(Guid dbGuid, bool fSuspendCopy, uint errorEventId, string failedMsg)
        {
            ReplicaInstanceManager replicaInstanceManager = Dependencies.ReplayCoreManager.ReplicaInstanceManager;

            replicaInstanceManager.RequestSuspendAndFail_SupportApi(dbGuid, fSuspendCopy, errorEventId, failedMsg, "Suspended by the SupportApi SetFailedAndSuspended() test call.", false);
        }
 public ConfigurationUpdater(ReplicaInstanceManager riManager, ReplaySystemQueue systemQueue) : base(TimeSpan.Zero, TimeSpan.FromMilliseconds((double)RegistryParameters.ConfigUpdaterTimerIntervalSlow), "PeriodicConfigurationChecker")
 {
     this.m_riManager   = riManager;
     this.m_systemQueue = systemQueue;
 }
 public ReplaySystemRunConfigurationUpdaterFullScan(ReplicaInstanceManager riManager, ReplayConfigChangeHints changeHint) : base(riManager)
 {
     this.WaitForCompletion = false;
     this.ChangeHint        = changeHint;
 }
Example #13
0
 // Token: 0x06002058 RID: 8280 RVA: 0x000969BE File Offset: 0x00094BBE
 public ReplicaInstanceRestartOperation(RestartInstanceWrapper instanceWrapper, ReplicaInstanceManager riManager) : base(instanceWrapper.OldReplicaInstance.ReplicaInstance)
 {
     base.IsDuplicateAllowed       = false;
     this.m_instanceWrapper        = instanceWrapper;
     this.m_replicaInstanceManager = riManager;
 }