/// <summary> /// Initializes a new instance of the BeginCheckpointLogRecord class. /// </summary> /// <param name="dummy">Used to indicate that this is not an Invalid BeginCheckpointLogRecord.</param> private BeginCheckpointLogRecord(bool dummy) : base(LogRecordType.BeginCheckpoint, LogicalSequenceNumber.ZeroLsn, null) { this.IsFirstCheckpointOnFullCopy = false; this.progressVector = ProgressVector.Clone(ProgressVector.ZeroProgressVector, 0, LogicalSequenceNumber.ZeroEpoch, LogicalSequenceNumber.ZeroEpoch); this.earliestPendingTransactionOffset = 0; this.earliestPendingTransaction = null; this.checkpointState = CheckpointState.Completed; this.lastStableLsn = LogicalSequenceNumber.ZeroLsn; this.epoch = LogicalSequenceNumber.ZeroEpoch; // Indicates that a full backup has not been taken yet. this.highestBackedUpEpoch = LogicalSequenceNumber.ZeroEpoch; this.highestBackedUpLsn = LogicalSequenceNumber.ZeroLsn; // Indicates that the current backup stream has zero logs and hence 0 KB size. this.backupLogRecordCount = (uint)0; this.backupLogSize = (uint)0; this.earliestPendingTransactionInvalidated = 0; this.lastPeriodicCheckpointTimeTicks = DateTime.Now.Ticks; this.lastPeriodicTruncationTimeTicks = this.lastPeriodicCheckpointTimeTicks; }
/// <summary> /// Initializes a new instance of the BeginCheckpointLogRecord class. /// </summary> /// <remarks>Called when the replicator decides to checkpoint.</remarks> internal BeginCheckpointLogRecord( bool isFirstCheckpointOnFullCopy, ProgressVector progressVector, BeginTransactionOperationLogRecord earliestPendingTransaction, Epoch headEpoch, Epoch epoch, LogicalSequenceNumber lsn, PhysicalLogRecord lastLinkedPhysicalRecord, BackupLogRecord lastCompletedBackupLogRecord, uint progressVectorMaxEntries, long periodicCheckpointTimeTicks, long periodicTruncationTimeTicks) : base(LogRecordType.BeginCheckpoint, lsn, lastLinkedPhysicalRecord) { this.IsFirstCheckpointOnFullCopy = isFirstCheckpointOnFullCopy; this.progressVector = ProgressVector.Clone(progressVector, progressVectorMaxEntries, lastCompletedBackupLogRecord.HighestBackedUpEpoch, headEpoch); this.earliestPendingTransactionOffset = LogicalLogRecord.InvalidLogicalRecordOffset; this.earliestPendingTransaction = earliestPendingTransaction; this.checkpointState = CheckpointState.Invalid; this.lastStableLsn = LogicalSequenceNumber.InvalidLsn; this.epoch = (earliestPendingTransaction != null) ? earliestPendingTransaction.RecordEpoch : epoch; // Initialize backup log record fields. this.highestBackedUpEpoch = lastCompletedBackupLogRecord.HighestBackedUpEpoch; this.highestBackedUpLsn = lastCompletedBackupLogRecord.HighestBackedUpLsn; this.backupLogRecordCount = lastCompletedBackupLogRecord.BackupLogRecordCount; this.backupLogSize = lastCompletedBackupLogRecord.BackupLogSizeInKB; this.earliestPendingTransactionInvalidated = 0; this.lastPeriodicCheckpointTimeTicks = periodicCheckpointTimeTicks; this.lastPeriodicTruncationTimeTicks = periodicTruncationTimeTicks; this.UpdateApproximateDiskSize(); }