// Token: 0x060023BE RID: 9150 RVA: 0x000A7870 File Offset: 0x000A5A70 public void SetBroken(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, Exception exception, params string[] setBrokenArgs) { lock (this) { this.SetBrokenInterface.SetBroken(failureTag, setBrokenEventTuple, exception, setBrokenArgs); } }
private void SetDisconnectedInternal(FailureTag failureTag, ExEventLog.EventTuple setDisconnectedEventTuple, params string[] setDisconnectedArgs) { string[] argumentsWithDb = ReplicaInstanceContext.GetArgumentsWithDb(setDisconnectedArgs, this.m_displayName); int num; string text = setDisconnectedEventTuple.EventLogToString(out num, argumentsWithDb); lock (this.m_instance) { if (!this.FailureInfo.IsFailed) { this.LogCrimsonEventOnStateChange <bool>("Disconnected", this.FailureInfo.IsDisconnected, true); this.FailureInfo.SetDisconnected(setDisconnectedEventTuple, new LocalizedString(text)); if (this.m_perfmonCounters != null) { this.m_perfmonCounters.Disconnected = 1L; } } else { ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <string>((long)this.GetHashCode(), "{0} SetDisconnected ignored because RI is already marked Failed.", this.m_displayName); } this.ExternalStatus.Refresh(); } bool flag2; setDisconnectedEventTuple.LogEvent(this.m_identity, out flag2, argumentsWithDb); ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <string, string>((long)this.GetHashCode(), "{0} SetDisconnected because {1}", this.m_displayName, text); }
public void DiscardLogs() { GranularWriter.Tracer.TraceDebug <string>((long)this.GetHashCode(), "DiscardLogs: {0}", this.m_config.LogInspectorPath); FailureTag failureTag = FailureTag.IoHard; Exception ex = null; string text = string.Empty; try { foreach (string text2 in Directory.GetFiles(this.m_config.LogInspectorPath, "*.jsl")) { text = text2; File.Delete(text2); } } catch (IOException ex2) { ex = ex2; failureTag = ReplicaInstance.IOExceptionToFailureTag(ex2); } catch (UnauthorizedAccessException ex3) { ex = ex3; } if (ex != null) { GranularWriter.Tracer.TraceError <string, Exception>((long)this.GetHashCode(), "Deleting file '{0}' failed with exception {1}", text, ex); this.m_setBroken.SetBroken(failureTag, ReplayEventLogConstants.Tuple_CouldNotDeleteLogFile, ex, new string[] { text, ex.ToString() }); throw new GranularReplicationTerminatedException(ex.Message, ex); } }
// Token: 0x0600013D RID: 317 RVA: 0x00006CE1 File Offset: 0x00004EE1 internal DatabaseFailureItem(FailureNameSpace nameSpace, FailureTag tag, Guid guid, string message) { this.NameSpace = nameSpace; this.Tag = tag; this.Guid = guid; this.Message = message; }
// Token: 0x06000D38 RID: 3384 RVA: 0x0003A480 File Offset: 0x00038680 public void SetBroken(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, params string[] setBrokenArgs) { this.m_fBroken = true; string[] argumentsWithDb = ReplicaInstance.GetArgumentsWithDb(setBrokenArgs, this.m_dbIdentity); int num; string value = setBrokenEventTuple.EventLogToString(out num, argumentsWithDb); this.m_errorMessage = new LocalizedString(value); }
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(); } }
// Token: 0x06000FA1 RID: 4001 RVA: 0x00043878 File Offset: 0x00041A78 internal static void PublishAction(FailureTag failureTag, Guid databaseGuid, string dbInstanceName, IoErrorInfo ioErrorInfo) { ExTraceGlobals.FaultInjectionTracer.TraceTest <FailureTag>(4033228093U, ref failureTag); FailureItemPublisherHelper.Trace("Replay Publishing Action {0} Database {1}", new object[] { failureTag, databaseGuid }); FailureItemPublisherHelper.PublishFailureItem(failureTag, databaseGuid, dbInstanceName, ioErrorInfo); }
// Token: 0x06000FA0 RID: 4000 RVA: 0x00043828 File Offset: 0x00041A28 internal static void PublishActionAndLogEvent(FailureTag failureTag, Guid databaseGuid, string dbInstanceName, ExEventLog.EventTuple errorEventTuple, params string[] eventParams) { FailureItemPublisherHelper.Trace("Replay Publishing event {0} Action {1} Database {2}", new object[] { DiagCore.GetEventViewerEventId(errorEventTuple), failureTag, databaseGuid }); errorEventTuple.LogEvent(null, eventParams); FailureItemPublisherHelper.PublishAction(failureTag, databaseGuid, dbInstanceName); }
// Token: 0x06000FA3 RID: 4003 RVA: 0x000438D0 File Offset: 0x00041AD0 internal static void PublishFailureItem(FailureNameSpace nameSpace, FailureTag failureTag, Guid databaseGuid, string dbInstanceName, IoErrorInfo ioErrorInfo) { DatabaseFailureItem databaseFailureItem = new DatabaseFailureItem(nameSpace, failureTag, databaseGuid); databaseFailureItem.InstanceName = dbInstanceName; databaseFailureItem.IoError = ioErrorInfo; try { databaseFailureItem.Publish(); } catch (ExDbApiException ex) { FailureItemPublisherHelper.Trace("Failed to publish failure item {0} (error:{1})", new object[] { databaseFailureItem, ex.ToString() }); ReplayEventLogConstants.Tuple_FailedToPublishFailureItem.LogEvent(null, new object[] { databaseFailureItem.ToString(), ex.Message }); } }
private bool IsNonSuppressableFailureTag(FailureTag tag) { return(tag == FailureTag.Reseed || tag == FailureTag.Configuration); }
public void SetDisconnected(FailureTag failureTag, ExEventLog.EventTuple setDisconnectedEventTuple, params string[] setDisconnectedArgs) { this.SetDisconnectedInternal(failureTag, setDisconnectedEventTuple, setDisconnectedArgs); }
protected override void TimerCallbackInternal() { LogTruncater.Tracer.TraceDebug <string, DateTime>((long)this.GetHashCode(), "TimerCallback: {0}: Entered at {1}", this.Configuration.Name, DateTime.UtcNow); if (base.PrepareToStopCalled || this.m_replicaInstanceContext.Initializing || this.m_replicaInstanceContext.Resynchronizing || this.m_replicaInstanceContext.Seeding) { LogTruncater.Tracer.TraceDebug <string>((long)this.GetHashCode(), "TimerCallback: {0}: The instance is stopping or checking stage, abort this timercallback", this.Configuration.Name); return; } if (this.Configuration.DestinationEdbPath == null) { LogTruncater.Tracer.TraceDebug <string>((long)this.GetHashCode(), "TimerCallback: {0}: Returns since we have no database.", this.Configuration.Name); return; } LogTruncater.Tracer.TraceDebug((long)this.GetHashCode(), "TimerCallback: {0} : m_localReplayerGen = 0x{1:X}, m_localInspectorGen = 0x{2:X}, m_lowestGenRequiredGlobally = 0x{3:X}, m_genTruncatedLocally = 0x{4:X}.", new object[] { this.Configuration.Name, this.m_localReplayerGen, this.m_localInspectorGen, this.m_lowestGenRequiredGlobally, this.m_genTruncatedLocally }); long num = this.CalculateGlobalTruncateInput(); if (num <= 0L) { LogTruncater.Tracer.TraceDebug <string>((long)this.GetHashCode(), "TimerCallback: {0}: Exiting because inspector/replayer haven't established position yet.", this.Configuration.Name); return; } num = this.GetExtendedGeneration(num); Exception arg = null; bool flag = false; try { this.LogShipCall(num, false); long num2 = this.CalculatePassiveTruncationPoint(); LooseTruncation looseTruncation = new LooseTruncation(); if (looseTruncation.Enabled && looseTruncation.SpaceIsLow(this.m_configuration)) { long num3 = looseTruncation.MinRequiredGen(this.FileChecker, this.Configuration); LogTruncater.Tracer.TraceDebug <long, long>((long)this.GetHashCode(), "LooseTruncation MinRequiredGen={0} NormalLocalGen={1}", num3, num2); if (num3 > num2) { ReplayCrimsonEvents.LooseTruncationOnPassiveBeingUsed.LogPeriodic <string, string, long, long>(this.Configuration.Identity, DiagCore.DefaultEventSuppressionInterval, this.Configuration.Identity, this.Configuration.DatabaseName, num2, num3); num2 = num3; } } if (num2 > this.m_genTruncatedLocally) { long num4 = num2; if (this.m_configuration.TruncationLagTime != EnhancedTimeSpan.Zero) { if (this.m_genTruncatedLocally == 0L) { num4 = this.FileChecker.FileState.LowestGenerationPresent; } else { num4 = this.m_genTruncatedLocally; } while (num4 < num2) { if (base.PrepareToStopCalled) { throw new OperationAbortedException(); } DateTime fileTime = this.GetFileTime(num4); if ((DateTime)ExDateTime.UtcNow - fileTime < this.m_configuration.TruncationLagTime) { LogTruncater.Tracer.TraceDebug <long, DateTime, string>((long)this.GetHashCode(), "TimerCallback: {2}: Log 0x{0:X} with time '{1}' protected by TruncationLag", num4, fileTime, this.Configuration.Name); break; } num4 += 1L; } } if (num4 != this.m_genTruncatedLocally) { for (long num5 = this.FileChecker.FileState.LowestGenerationPresent; num5 < num4; num5 += 1L) { string text = this.Configuration.BuildFullLogfileName(num5); Exception ex = FileCleanup.Delete(text); if (ex != null) { LogTruncater.Tracer.TraceError <string, Exception>((long)this.GetHashCode(), "Truncation failed to delete {0}: {1}", text, ex); uint hrforException = (uint)Marshal.GetHRForException(ex); throw new FailedToTruncateLocallyException(hrforException, ex.Message, ex); } if (base.PrepareToStopCalled) { throw new OperationAbortedException(); } } this.m_genTruncatedLocally = num4; this.ProbeForLowestLogPresent(); } } flag = true; } catch (OperationAbortedException arg2) { flag = true; LogTruncater.Tracer.TraceDebug <OperationAbortedException>((long)this.GetHashCode(), "Stop detected: {0}", arg2); } catch (IOException ex2) { flag = true; LogTruncater.Tracer.TraceError <string, IOException>((long)this.GetHashCode(), "TimerCallback: {0}: Got an IO exception and probably the file we are going to delete doesn't exist : {1}", this.Configuration.Name, ex2); ReplayEventLogConstants.Tuple_LogTruncationLocalFailure.LogEvent(null, new object[] { this.Configuration.DisplayName, ex2.Message }); } catch (FailedToOpenLogTruncContextException ex3) { arg = ex3; ReplayEventLogConstants.Tuple_LogTruncationOpenFailed.LogEvent(this.Configuration.Identity, new object[] { this.Configuration.DisplayName, ex3.Hresult, ex3.Message }); } catch (CopyUnknownToActiveLogTruncationException ex4) { arg = ex4; ReplayEventLogConstants.Tuple_LogTruncationOpenFailed.LogEvent(this.Configuration.Identity, new object[] { this.Configuration.DisplayName, ex4.Hresult, ex4.Message }); } catch (FailedToNotifySourceLogTruncException ex5) { arg = ex5; ReplayEventLogConstants.Tuple_LogTruncationSourceFailure.LogEvent(null, new object[] { this.Configuration.DisplayName, ex5.Message }); } catch (FailedToTruncateLocallyException ex6) { arg = ex6; ReplayEventLogConstants.Tuple_LogTruncationLocalFailure.LogEvent(this.Configuration.DisplayName, new object[] { this.Configuration.DisplayName, ex6.Message }); FailureTag failureTag = FailureTag.NoOp; uint hresult = ex6.Hresult; if (hresult == 3355444222U) { failureTag = FailureTag.IoHard; } if (failureTag != FailureTag.NoOp) { FailureItemPublisherHelper.PublishAction(failureTag, this.m_configuration.IdentityGuid, this.m_configuration.DatabaseName); } } finally { if (!flag) { LogTruncater.Tracer.TraceError <string, Exception>((long)this.GetHashCode(), "TimerCallback: {0}: Esebcli2 call failed, or unhandled exception occurred. Disposing m_logShipContext... Exception: {1}", this.Configuration.Name, arg); if (this.m_logShipContext != null) { this.m_logShipContext.Dispose(); this.m_logShipContext = null; } LogTruncater.Tracer.TraceDebug <string>((long)this.GetHashCode(), "TimerCallback: {0}: m_logShipContext disposed.", this.Configuration.Name); } } this.m_perfmonCounters.TruncatedGenerationNumber = this.m_genTruncatedLocally; }
private bool IsSuppressableFailureTag(FailureTag tag) { return(tag == FailureTag.AlertOnly || tag == FailureTag.NoOp); }
// Token: 0x06000FC7 RID: 4039 RVA: 0x00044731 File Offset: 0x00042931 public void PublishAction(FailureTag failureTag, Guid databaseGuid, string dbInstanceName, IoErrorInfo ioErrorInfo) { FailureItemPublisherHelper.PublishAction(failureTag, databaseGuid, dbInstanceName, ioErrorInfo); }
// Token: 0x0600013C RID: 316 RVA: 0x00006CC4 File Offset: 0x00004EC4 internal DatabaseFailureItem(FailureNameSpace nameSpace, FailureTag tag, Guid guid) { this.NameSpace = nameSpace; this.Tag = tag; this.Guid = guid; }
// Token: 0x06000F9F RID: 3999 RVA: 0x0004380C File Offset: 0x00041A0C internal static void PublishAction(FailureTag failureTag, Guid databaseGuid, string dbInstanceName) { ExTraceGlobals.FaultInjectionTracer.TraceTest <FailureTag>(4033228093U, ref failureTag); FailureItemPublisherHelper.PublishFailureItem(failureTag, databaseGuid, dbInstanceName, null); }
// Token: 0x06000D3B RID: 3387 RVA: 0x0003A4DF File Offset: 0x000386DF public void SetDisconnected(FailureTag failureTag, ExEventLog.EventTuple failureNotificationEventTuple, ExEventLog.EventTuple setBrokenEventTuple, params string[] setBrokenArgs) { this.SetDisconnected(failureTag, setBrokenEventTuple, setBrokenArgs); }
public void SetBroken(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, params string[] setBrokenArgs) { this.SetBroken(failureTag, setBrokenEventTuple, null, setBrokenArgs); }
public void SetBrokenAndThrow(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, Exception exception, params string[] setBrokenArgs) { string[] argumentsWithDb = ReplicaInstanceContext.GetArgumentsWithDb(setBrokenArgs, this.m_displayName); this.SetBrokenInternal(failureTag, setBrokenEventTuple, new ExtendedErrorInfo(exception), argumentsWithDb); throw new SetBrokenControlTransferException(); }
// Token: 0x06000FA2 RID: 4002 RVA: 0x000438C3 File Offset: 0x00041AC3 internal static void PublishFailureItem(FailureTag failureTag, Guid databaseGuid, string dbInstanceName, IoErrorInfo ioErrorInfo) { FailureItemPublisherHelper.PublishFailureItem(FailureNameSpace.Replay, failureTag, databaseGuid, dbInstanceName, ioErrorInfo); }
// Token: 0x06000D37 RID: 3383 RVA: 0x0003A472 File Offset: 0x00038672 public void SetBroken(FailureTag failureTag, ExEventLog.EventTuple failureNotificationEventTuple, string[] failureNotificationMessageArgs, ExEventLog.EventTuple setBrokenEventTuple, params string[] setBrokenArgs) { this.SetBroken(failureTag, setBrokenEventTuple, setBrokenArgs); }
internal static bool Win32ErrorCodeToIOFailureTag(int win32code, FailureTag defaultFailureTag, out FailureTag failureTag) { failureTag = FailureTag.NoOp; if (win32code <= 80) { switch (win32code) { case 0: case 2: break; case 1: case 4: goto IL_77; case 3: case 5: failureTag = FailureTag.Configuration; return(true); default: switch (win32code) { case 38: break; case 39: goto IL_72; default: if (win32code != 80) { goto IL_77; } break; } break; } } else if (win32code <= 112) { if (win32code != 87) { if (win32code != 112) { goto IL_77; } goto IL_72; } } else if (win32code != 183) { if (win32code != 206) { goto IL_77; } failureTag = FailureTag.Unrecoverable; return(true); } failureTag = FailureTag.NoOp; return(true); IL_72: failureTag = FailureTag.Space; return(true); IL_77: if (FileOperations.IsRetryableIOErrorCode(win32code)) { failureTag = FailureTag.NoOp; return(true); } if (FileOperations.IsFatalIOErrorCode(win32code)) { failureTag = FailureTag.IoHard; return(true); } failureTag = defaultFailureTag; return(false); }
// Token: 0x06000D3A RID: 3386 RVA: 0x0003A4CA File Offset: 0x000386CA public void SetBroken(FailureTag failureTag, ExEventLog.EventTuple failureNotificationEventTuple, ExEventLog.EventTuple setBrokenEventTuple, Exception exception, params string[] setBrokenArgs) { this.m_exception = exception; this.SetBroken(failureTag, failureNotificationEventTuple, setBrokenEventTuple, setBrokenArgs); }
public MonitoredDatabaseInitException StartMonitoring() { Exception ex = null; MonitoredDatabase.Tracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "StartMonitoring: '{0}' {1}", this.DatabaseName, this.DatabaseGuid); try { if (!this.m_fPassive) { this.SetupWatcher(); } ExTraceGlobals.FaultInjectionTracer.TraceTest(2294689085U); TimeSpan invokeTimeout = TimeSpan.FromSeconds((double)RegistryParameters.StartupLogScanTimeoutInSec); InvokeWithTimeout.Invoke(delegate() { this.DetermineEndOfLog(); }, invokeTimeout); if (!this.m_fPassive) { this.m_selfCheckEnabled = true; } MonitoredDatabase.Tracer.TraceDebug <string, long>((long)this.GetHashCode(), "Monitoring database {0}. EOL=0x{1:x}", this.m_config.DatabaseName, this.m_currentEndOfLog.Generation); } catch (TimeoutException ex2) { ex = ex2; } catch (ArgumentException ex3) { ex = ex3; } catch (IOException ex4) { ex = ex4; } catch (UnauthorizedAccessException ex5) { ex = ex5; } catch (EsentErrorException ex6) { ex = ex6; } if (ex != null) { string text = string.Format("0x{0:X}", ex.HResult); MonitoredDatabase.Tracer.TraceError <string, string, Exception>((long)this.GetHashCode(), "StartMonitoring database {0} failed with HRESULT {1} exception {2}", this.m_config.DatabaseName, text, ex); ReplayCrimsonEvents.MonitoredDBFailedToStart.LogPeriodic <Guid, string, string, string, string, string>(this.DatabaseName, DiagCore.DefaultEventSuppressionInterval, this.DatabaseGuid, this.DatabaseName, ex.Message, text, ex.ToString(), this.m_sourceDir); if (this.IsPassiveCopy) { ReplayEventLogConstants.Tuple_PassiveMonitoredDBFailedToStart.LogEvent(this.Identity, new object[] { this.DatabaseName, ex.ToString() }); } else { FailureTag failureTag = FailureTag.MonitoredDatabaseFailed; IOException ex7 = ex as IOException; if (ex7 != null && DirectoryOperations.IsPathOnLockedVolume(this.m_sourceDir)) { failureTag = FailureTag.LockedVolume; } ReplayEventLogConstants.Tuple_ActiveMonitoredDBFailedToStart.LogEvent(this.Identity, new object[] { this.DatabaseName, ex.ToString() }); FailureItemPublisherHelper.PublishAction(failureTag, this.DatabaseGuid, this.DatabaseName); } this.StopMonitoring(); return(new MonitoredDatabaseInitException(this.DatabaseName, ex.Message, ex)); } return(null); }