Skip to content

Commit

Permalink
Fix CommitRecord physicalAddress offset (#285)
Browse files Browse the repository at this point in the history
Co-authored-by: Tal Zaccai <talzacc@microsoft.com>
  • Loading branch information
TedHartMS and TalZaccai committed Apr 18, 2024
1 parent 8f86b49 commit 23e13f0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public unsafe bool GetNext(MemoryPool<byte> pool, out IMemoryOwner<byte> entry,
if (isCommitRecord)
{
TsavoriteLogRecoveryInfo info = new();
info.Initialize(new ReadOnlySpan<byte>((byte*)physicalAddress, entryLength));
info.Initialize(new ReadOnlySpan<byte>((byte*)(headerSize + physicalAddress), entryLength));
if (info.CommitNum != long.MaxValue) continue;

// Otherwise, no more entries
Expand Down Expand Up @@ -441,7 +441,7 @@ public unsafe bool GetNext(MemoryPool<byte> pool, out IMemoryOwner<byte> entry,
if (isCommitRecord)
{
TsavoriteLogRecoveryInfo info = new();
info.Initialize(new ReadOnlySpan<byte>((byte*)physicalAddress, entryLength));
info.Initialize(new ReadOnlySpan<byte>((byte*)(headerSize + physicalAddress), entryLength));
if (info.CommitNum != long.MaxValue) continue;

// Otherwise, no more entries
Expand Down

0 comments on commit 23e13f0

Please sign in to comment.