diff --git a/cs/src/core/Index/FasterLog/FasterLog.cs b/cs/src/core/Index/FasterLog/FasterLog.cs index ebc47da8c..d3fe4e92b 100644 --- a/cs/src/core/Index/FasterLog/FasterLog.cs +++ b/cs/src/core/Index/FasterLog/FasterLog.cs @@ -976,8 +976,7 @@ public async ValueTask ReadRecordLengthAsync(long address, CancellationToke allocator.AsyncReadRecordToMemory(address, headerSize, AsyncGetHeaderOnlyFromDiskCallback, ref ctx); } epoch.Suspend(); - await ctx.completedRead.WaitAsync(token).ConfigureAwait(false); - + await ctx.completedRead.WaitAsync(token).ConfigureAwait(false); return GetRecordLengthAndFree(ctx.record); } @@ -1624,10 +1623,7 @@ private int GetRecordLengthAndFree(SectorAlignedMemory record) var ptr = record.GetValidPointer(); length = GetLength(ptr); - if (!VerifyChecksum(ptr, length)) - { - throw new FasterException("Checksum failed for read"); - } + // forego checksum verification since record may not be read in full by AsyncGetHeaderOnlyFromDiskCallback() } record.Return(); diff --git a/cs/src/core/Index/FasterLog/FasterLogIterator.cs b/cs/src/core/Index/FasterLog/FasterLogIterator.cs index 1a2a053e9..b5704d37d 100644 --- a/cs/src/core/Index/FasterLog/FasterLogIterator.cs +++ b/cs/src/core/Index/FasterLog/FasterLogIterator.cs @@ -342,10 +342,13 @@ public void CompleteUntil(long address) /// /// /// - public async ValueTask CompleteUntilRecordAtAsync(long recordStartAddress, CancellationToken token = default) + /// The actual completion address (end address of the record) + public async ValueTask CompleteUntilRecordAtAsync(long recordStartAddress, CancellationToken token = default) { int len = await fasterLog.ReadRecordLengthAsync(recordStartAddress, token: token); - CompleteUntil(recordStartAddress + headerSize + len); + long endAddress = recordStartAddress + headerSize + Align(len); + CompleteUntil(endAddress); + return endAddress; } internal void UpdateCompletedUntilAddress(long address)