Ejemplo n.º 1
0
        public static void SetCopyProperty(Guid dbGuid, string propName, string propVal)
        {
            MonitoredDatabase monitoredDatabase = MonitoredDatabase.FindMonitoredDatabase(Environment.MachineName, dbGuid);

            if (monitoredDatabase == null)
            {
                throw new ArgumentException(string.Format("Monitored database '{0}' not active", dbGuid));
            }
            if (MonitoredDatabase.StringIEquals(propName, "TestGranularReplicationExceptionDuringAcll"))
            {
                bool testGranularReplicationExceptionDuringAcll;
                if (!bool.TryParse(propVal, out testGranularReplicationExceptionDuringAcll))
                {
                    throw new ArgumentException("TestGranularReplicationExceptionDuringAcll must be a bool");
                }
                monitoredDatabase.TestGranularReplicationExceptionDuringAcll = testGranularReplicationExceptionDuringAcll;
                return;
            }
            else
            {
                if (!MonitoredDatabase.StringIEquals(propName, "TestGranularReplicationDeliveryDelay"))
                {
                    throw new ArgumentException(string.Format("'{0}' is not recognized", propName));
                }
                int testGranularReplicationDeliveryDelay;
                if (!int.TryParse(propVal, out testGranularReplicationDeliveryDelay))
                {
                    throw new ArgumentException("TestGranularReplicationDeliveryDelay must be an int");
                }
                monitoredDatabase.TestGranularReplicationDeliveryDelay = testGranularReplicationDeliveryDelay;
                return;
            }
        }
Ejemplo n.º 2
0
        private void SetBrokenInternal(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, ExtendedErrorInfo extendedErrorInfo, params string[] setBrokenArgsPlusDb)
        {
            int       num;
            string    text             = setBrokenEventTuple.EventLogToString(out num, setBrokenArgsPlusDb);
            Exception failureException = extendedErrorInfo.FailureException;
            int       num2             = 0;

            if (failureException != null)
            {
                num2 = failureException.HResult;
            }
            ReplayCrimsonEvents.SetBroken.LogPeriodic <Guid, string, string, string, Exception, int>(this.m_databaseName, DiagCore.DefaultEventSuppressionInterval, this.m_guid, this.m_databaseName, text, Environment.StackTrace, failureException, num2);
            bool flag = false;

            lock (this.m_instance)
            {
                flag = this.IsBroken;
                this.FailureInfo.SetBroken(setBrokenEventTuple, new LocalizedString(text), extendedErrorInfo);
                if (this.m_perfmonCounters != null)
                {
                    this.m_perfmonCounters.Failed       = 1L;
                    this.m_perfmonCounters.Disconnected = 0L;
                    if (this.Suspended)
                    {
                        this.m_perfmonCounters.FailedSuspended = 1L;
                    }
                }
                bool flag3;
                setBrokenEventTuple.LogEvent(this.m_identity, out flag3, setBrokenArgsPlusDb);
                ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <string, FailureTag, string>((long)this.GetHashCode(), "{0} SetBroken with tag {1} because {2}", this.m_displayName, failureTag, text);
                MonitoredDatabase monitoredDatabase = MonitoredDatabase.FindMonitoredDatabase(this.ReplicaInstance.Configuration.ServerName, this.m_guid);
                if (monitoredDatabase != null && this.PassiveSeedingSourceContext != PassiveSeedingSourceContextEnum.None)
                {
                    ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <Guid>((long)this.GetHashCode(), "Cancel seeding for mdb {0}", this.m_guid);
                    SourceSeedTable.Instance.CancelSeedingIfAppropriate(SourceSeedTable.CancelReason.CopyFailed, monitoredDatabase.DatabaseGuid);
                }
                bool flag4 = false;
                if (flag3 && (!RegistryParameters.DisableSetBrokenFailureItemSuppression || this.IsSuppressableFailureTag(failureTag)) && !this.IsNonSuppressableFailureTag(failureTag))
                {
                    flag4 = true;
                }
                if (!flag4 && failureTag != FailureTag.NoOp)
                {
                    FailureItemPublisherHelper.PublishAction(failureTag, this.m_guid, this.m_databaseName);
                }
                if (!flag)
                {
                    this.FailureInfo.PersistFailure(this.m_replayState);
                }
                this.ExternalStatus.Refresh();
            }
            if (!flag)
            {
                this.m_instance.PrepareToStop();
            }
        }
Ejemplo n.º 3
0
        // Token: 0x06001AC4 RID: 6852 RVA: 0x00072D8C File Offset: 0x00070F8C
        private MonitoredDatabase GetMonitoredDatabase()
        {
            MonitoredDatabase monitoredDatabase = MonitoredDatabase.FindMonitoredDatabase(this.m_channel.LocalNodeName, this.DatabaseGuid);

            if (monitoredDatabase == null)
            {
                throw new SourceDatabaseNotFoundException(this.DatabaseGuid, this.m_channel.LocalNodeName);
            }
            return(monitoredDatabase);
        }
Ejemplo n.º 4
0
        public void UpdateLastLogGeneratedAndEndOfLogInfo(long highestLogGen)
        {
            ActiveManagerCore.SetLastLogGenerationNumber(this.DatabaseGuid, highestLogGen);
            MonitoredDatabase monitoredDatabase = MonitoredDatabase.FindMonitoredDatabase(this.ServerName, this.DatabaseGuid);

            if (monitoredDatabase != null)
            {
                monitoredDatabase.UpdateCurrentEndOfLog(highestLogGen, true);
            }
        }