/// <inheritdoc/> public override void OnCommitFinished(FasterLogRecoveryInfo info) { Interlocked.Decrement(ref commitInProgress); if (shouldRetry) { shouldRetry = false; log.Commit(); } }
internal unsafe bool ScanForwardForCommit(ref FasterLogRecoveryInfo info, long commitNum = -1) { epoch.Resume(); var foundCommit = false; try { // Continue looping until we find a record that is a commit record while (GetNextInternal(out long physicalAddress, out var entryLength, out long currentAddress, out long nextAddress, out var isCommitRecord)) { if (!isCommitRecord) { continue; } foundCommit = true; byte[] entry; // We allocate a byte array from heap entry = new byte[entryLength]; fixed(byte *bp = entry) Buffer.MemoryCopy((void *)(headerSize + physicalAddress), bp, entryLength, entryLength); info.Initialize(new BinaryReader(new MemoryStream(entry))); Debug.Assert(info.CommitNum != -1); // If we have already found the commit number we are looking for, can stop early if (info.CommitNum == commitNum) { break; } } } catch (FasterException) { // If we are here --- simply stop scanning because we ran into an incomplete entry } finally { epoch.Suspend(); } if (info.CommitNum == commitNum) { return(true); } // User wants any commie if (commitNum == -1) { return(foundCommit); } // requested commit not found return(false); }
/// <inheritdoc/> public override void OnCommitFinished(FasterLogRecoveryInfo info) { }
/// <inheritdoc/> public override void OnCommitCreated(FasterLogRecoveryInfo info) { }
/// <summary> /// Invoked after a commit is complete /// </summary> /// <param name="info"> commit content </param> public abstract void OnCommitFinished(FasterLogRecoveryInfo info);
/// <summary> /// Invoked when a commit is successfully created /// </summary> /// <param name="info"> commit content </param> public abstract void OnCommitCreated(FasterLogRecoveryInfo info);