// Token: 0x06001AC5 RID: 6853 RVA: 0x00072DCC File Offset: 0x00070FCC public void SendLogFiles() { MonitoredDatabase monitoredDatabase = this.GetMonitoredDatabase(); string suffix = '.' + monitoredDatabase.Config.LogExtension; DirectoryInfo di = new DirectoryInfo(monitoredDatabase.Config.SourceLogPath); long num = ShipControl.HighestGenerationInDirectory(di, monitoredDatabase.Config.LogFilePrefix, suffix); long num2 = ShipControl.LowestGenerationInDirectory(di, monitoredDatabase.Config.LogFilePrefix, suffix, false); for (long num3 = num2; num3 <= num; num3 += 1L) { this.CheckSeedingCancelled(); try { monitoredDatabase.SendLog(num3, this.m_channel, null); } catch (FileIOonSourceException ex) { ExTraceGlobals.SeederServerTracer.TraceDebug <long, Exception>((long)this.GetHashCode(), "failed to send generation 0x{0:X} because {1}", num3, ex.InnerException); this.m_channel.SendException(ex.InnerException); this.CancelSeeding(ex.LocalizedString); return; } } NotifyEndOfLogReply notifyEndOfLogReply = new NotifyEndOfLogReply(this.m_channel, NetworkChannelMessage.MessageType.NotifyEndOfLogReply, num, DateTime.UtcNow); this.TraceDebug("reached the end of log files", new object[0]); notifyEndOfLogReply.Send(); }
private void ProbeForLowestLogPresent() { DirectoryInfo di = new DirectoryInfo(this.Configuration.DestinationLogPath); long lowestGenerationPresent = ShipControl.LowestGenerationInDirectory(di, this.Configuration.LogFilePrefix, "." + this.Configuration.LogExtension, false); this.FileChecker.FileState.SetLowestGenerationPresent(lowestGenerationPresent); }
public long DetermineStartOfLog() { DirectoryInfo di = new DirectoryInfo(this.m_sourceDir); long num = ShipControl.LowestGenerationInDirectory(di, this.m_logPrefix, this.m_logSuffix, false); ExTraceGlobals.MonitoredDatabaseTracer.TraceDebug <long>((long)this.GetHashCode(), "DetermineStartOfLog 0x{0:x}", num); return(num); }
internal static void TryUpdateLastLogGenerationNumberOnMount(ReplayConfiguration config, LogStreamResetOnMount logReset, MountDirectPerformanceTracker mountPerf, int mountFlags, long highestLogGen) { bool flag = (mountFlags & 2) == 2; mountPerf.IsLossyMountEnabled = flag; mountPerf.HighestLogGenBefore = highestLogGen; mountPerf.HighestLogGenAfter = highestLogGen; ExTraceGlobals.ReplayManagerTracer.TraceDebug <string, Guid, bool>((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): fLossyMountEnabled = '{2}'", config.Name, config.IdentityGuid, flag); string logDirectory = config.DestinationLogPath; if (!flag) { long lowestLogGen = 0L; mountPerf.RunTimedOperation(MountDatabaseDirectOperation.LowestGenerationInDirectory, delegate { lowestLogGen = ShipControl.LowestGenerationInDirectory(new DirectoryInfo(logDirectory), config.LogFilePrefix, "." + config.LogExtension, true); }); if (lowestLogGen == 0L) { ExTraceGlobals.ReplayManagerTracer.TraceDebug((long)config.GetHashCode(), "Looks like a log stream reset"); logReset.ResetLogStream(); return; } } if (config.Type == ReplayConfigType.SingleCopySource) { ExTraceGlobals.ReplayManagerTracer.TraceDebug <string, Guid, ReplayConfigType>((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Skipping updating last log generation since the config is of type '{2}'.", config.DisplayName, config.IdentityGuid, config.Type); return; } try { if (highestLogGen > 0L) { ExTraceGlobals.ReplayManagerTracer.TraceDebug <string, Guid, long>((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Known highest log generation is {2}.", config.Name, config.IdentityGuid, highestLogGen); mountPerf.RunTimedOperation(MountDatabaseDirectOperation.GenerationAvailableInDirectory, delegate { if (!ShipControl.GenerationAvailableInDirectory(new DirectoryInfo(logDirectory), config.LogFilePrefix, "." + config.LogExtension, highestLogGen)) { ExTraceGlobals.ReplayManagerTracer.TraceDebug <string, Guid>((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Log file for known highest generation does not exist, will scan directory to determine the max generation.", config.Name, config.IdentityGuid); highestLogGen = 0L; } }); } if (highestLogGen <= 0L) { mountPerf.RunTimedOperation(MountDatabaseDirectOperation.HighestGenerationInDirectory, delegate { highestLogGen = ShipControl.HighestGenerationInDirectory(new DirectoryInfo(logDirectory), config.LogFilePrefix, "." + config.LogExtension); }); ExTraceGlobals.ReplayManagerTracer.TraceDebug((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Highest log in directory '{2}' is {3}.", new object[] { config.Name, config.IdentityGuid, logDirectory, highestLogGen }); } mountPerf.HighestLogGenAfter = highestLogGen; if (highestLogGen <= 0L) { ExTraceGlobals.ReplayManagerTracer.TraceDebug <string, Guid>((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Skipping updating last log generation since highest log gen is <= 0.", config.Name, config.IdentityGuid); } else { mountPerf.RunTimedOperation(MountDatabaseDirectOperation.UpdateLastLogGeneratedInClusDB, delegate { config.UpdateLastLogGeneratedAndEndOfLogInfo(highestLogGen); }); } } catch (IOException ex) { ExTraceGlobals.ReplayManagerTracer.TraceError((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Caught IO exception for path '{2}'. {3}", new object[] { config.Name, config.IdentityGuid, logDirectory, ex }); } catch (SecurityException ex2) { ExTraceGlobals.ReplayManagerTracer.TraceError((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Caught SecurityException for path '{2}'. {3}", new object[] { config.Name, config.IdentityGuid, logDirectory, ex2 }); } catch (ClusterException arg) { ExTraceGlobals.ReplayManagerTracer.TraceError <string, Guid, ClusterException>((long)config.GetHashCode(), "TryUpdateLastLogGenerationNumber {0} ({1}): Caught exception at SetLastLogGenerationNumber. {2}", config.Name, config.IdentityGuid, arg); } }