// Token: 0x06001BBB RID: 7099 RVA: 0x00076E40 File Offset: 0x00075040
        private void LogLossyAcll()
        {
            List <string> list        = new List <string>(4);
            string        simpleName  = AmServerName.GetSimpleName(this.m_configuration.SourceMachine);
            string        machineName = Environment.MachineName;

            foreach (IADDatabaseCopy iaddatabaseCopy in this.m_configuration.Database.DatabaseCopies)
            {
                if (!MachineName.Comparer.Equals(iaddatabaseCopy.HostServerName, simpleName) && !MachineName.Comparer.Equals(iaddatabaseCopy.HostServerName, machineName))
                {
                    list.Add(iaddatabaseCopy.HostServerName);
                }
            }
            string text       = string.Join(",", list.ToArray());
            long   generation = this.LastLogShipped;

            if (this.m_logCopier.GranuleUsedAsE00)
            {
                generation = 0L;
            }
            string               text2 = this.m_configuration.BuildFullLogfileName(generation);
            int                  num   = 0;
            Exception            ex;
            EseLogRecordPosition lastLogRecordPosition = EseHelper.GetLastLogRecordPosition(text2, this.m_configuration.E00LogBackupPath, out ex);

            if (lastLogRecordPosition != null)
            {
                num = lastLogRecordPosition.ByteOffsetToStartOfRec + lastLogRecordPosition.LogRecordLength;
            }
            else
            {
                AttemptCopyLastLogs.Tracer.TraceError <string, string>((long)this.GetHashCode(), "Failed to GetLastLogRecordPosition for '{0}': {1}", text2, (ex == null) ? "log appears empty" : ex.ToString());
            }
            ReplayCrimsonEvents.AcllReportedLoss2.Log <string, Guid, long, string, string, string, string, bool, string, string, string>(this.m_configuration.DatabaseName, this.m_configuration.IdentityGuid, this.NumberOfLogsLost, string.Format("0x{0:X}", this.LastLogNotified), string.Format("0x{0:X}", this.LastLogShipped), string.Format("0x{0:X}", num), string.Format("{0} UTC", this.LastLogInspectedTime.ToString("yyyy-MM-dd HH:mm:ss.fff")), this.m_logCopier.GranuleUsedAsE00, this.m_configuration.SourceMachine, text, this.m_uniqueOperationId);
        }
Esempio n. 2
0
        // Token: 0x0600095F RID: 2399 RVA: 0x0002C270 File Offset: 0x0002A470
        public static EseLogRecordPosition GetLastLogRecordPosition(string logfileName, string temporaryDirectory, out Exception ex)
        {
            EseLogRecordPosition result = null;

            ex = null;
            try
            {
                EseLogRecord[] logRecords = EseHelper.GetLogRecords(logfileName, temporaryDirectory);
                if (logRecords.Length > 0)
                {
                    result = EseHelper.GetLastLogRecordPosition(logRecords);
                }
            }
            catch (EsentErrorException ex2)
            {
                ex = ex2;
            }
            catch (IOException ex3)
            {
                ex = ex3;
            }
            catch (UnauthorizedAccessException ex4)
            {
                ex = ex4;
            }
            return(result);
        }
Esempio n. 3
0
 // Token: 0x0600095E RID: 2398 RVA: 0x0002C120 File Offset: 0x0002A320
 public static bool IsLogfileEqual(string logfile1, string logfile2, string temporaryDirectory, EseLogRecordPosition lastRec1, EseLogRecordPosition lastRec2)
 {
     EseLogRecord[] logRecords  = EseHelper.GetLogRecords(logfile1, temporaryDirectory);
     EseLogRecord[] logRecords2 = EseHelper.GetLogRecords(logfile2, temporaryDirectory);
     if (lastRec1 != null)
     {
         EseLogRecordPosition lastLogRecordPosition = EseHelper.GetLastLogRecordPosition(logRecords);
         if (lastLogRecordPosition != null)
         {
             lastRec1.LogPos          = lastLogRecordPosition.LogPos;
             lastRec1.LogRecordLength = lastLogRecordPosition.LogRecordLength;
             lastRec1.LogSectorSize   = lastLogRecordPosition.LogSectorSize;
         }
     }
     if (lastRec2 != null)
     {
         EseLogRecordPosition lastLogRecordPosition2 = EseHelper.GetLastLogRecordPosition(logRecords2);
         if (lastLogRecordPosition2 != null)
         {
             lastRec2.LogPos          = lastLogRecordPosition2.LogPos;
             lastRec2.LogRecordLength = lastLogRecordPosition2.LogRecordLength;
             lastRec2.LogSectorSize   = lastLogRecordPosition2.LogSectorSize;
         }
     }
     if (logRecords2.Length != logRecords.Length)
     {
         ExTraceGlobals.EseutilWrapperTracer.TraceDebug(0L, "IsLogfileEqual({0},{1}) returns false. {0} has {2} records. {1} has {3} records.", new object[]
         {
             logfile1,
             logfile2,
             logRecords.Length,
             logRecords2.Length
         });
         return(false);
     }
     for (int i = 0; i < logRecords.Length; i++)
     {
         if (logRecords[i].ToString() != logRecords2[i].ToString())
         {
             ExTraceGlobals.EseutilWrapperTracer.TraceDebug(0L, "IsLogfileEqual({0},{1}) returns false. {0} has {2} records. {1} has {3} records. The differing log records are {4} and {5}. Differing position is {6}.", new object[]
             {
                 logfile1,
                 logfile2,
                 logRecords.Length,
                 logRecords2.Length,
                 logRecords[i],
                 logRecords2[i],
                 i
             });
             return(false);
         }
     }
     return(true);
 }
Esempio n. 4
0
 // Token: 0x0600095D RID: 2397 RVA: 0x0002BF50 File Offset: 0x0002A150
 public static bool IsLogfileSubset(string logfile1, string logfile2, string temporaryDirectory, EseLogRecordPosition lastRec1, EseLogRecordPosition lastRec2)
 {
     EseLogRecord[] logRecords  = EseHelper.GetLogRecords(logfile1, temporaryDirectory);
     EseLogRecord[] logRecords2 = EseHelper.GetLogRecords(logfile2, temporaryDirectory);
     if (lastRec1 != null)
     {
         EseLogRecordPosition lastLogRecordPosition = EseHelper.GetLastLogRecordPosition(logRecords);
         if (lastLogRecordPosition != null)
         {
             lastRec1.LogPos          = lastLogRecordPosition.LogPos;
             lastRec1.LogRecordLength = lastLogRecordPosition.LogRecordLength;
             lastRec1.LogSectorSize   = lastLogRecordPosition.LogSectorSize;
         }
     }
     if (lastRec2 != null)
     {
         EseLogRecordPosition lastLogRecordPosition2 = EseHelper.GetLastLogRecordPosition(logRecords2);
         if (lastLogRecordPosition2 != null)
         {
             lastRec2.LogPos          = lastLogRecordPosition2.LogPos;
             lastRec2.LogRecordLength = lastLogRecordPosition2.LogRecordLength;
             lastRec2.LogSectorSize   = lastLogRecordPosition2.LogSectorSize;
         }
     }
     if (logRecords2.Length > logRecords.Length)
     {
         ExTraceGlobals.EseutilWrapperTracer.TraceDebug(0L, "IsLogfileSubset({0},{1}) returns false. {0} has {2} records. {1} has {3} records.", new object[]
         {
             logfile1,
             logfile2,
             logRecords.Length,
             logRecords2.Length
         });
         return(false);
     }
     for (int i = 0; i < logRecords2.Length - 1; i++)
     {
         bool flag = true;
         if ((!(logRecords[i] is EseChecksumRecord) || !(logRecords2[i] is EseChecksumRecord)) && logRecords[i].ToString() != logRecords2[i].ToString())
         {
             flag = false;
         }
         if (!flag)
         {
             ExTraceGlobals.EseutilWrapperTracer.TraceDebug(0L, "IsLogfileSubset({0},{1}) returns false. {0} has {2} records. {1} has {3} records. The differing log records are {4} and {5}. Differing position is {6}.", new object[]
             {
                 logfile1,
                 logfile2,
                 logRecords.Length,
                 logRecords2.Length,
                 logRecords[i],
                 logRecords2[i],
                 i
             });
             return(false);
         }
     }
     if (!(logRecords2[logRecords2.Length - 1] is EseEofRecord))
     {
         ExTraceGlobals.EseutilWrapperTracer.TraceDebug(0L, "IsLogfileSubset({0},{1}) returns false. {0} has {2} records. {1} has {3} records. File {1} does not end in an EOF record. The last record is {4}.", new object[]
         {
             logfile1,
             logfile2,
             logRecords.Length,
             logRecords2.Length,
             logRecords2[logRecords2.Length - 1]
         });
         return(false);
     }
     return(true);
 }