Skip to content

Commit

Permalink
[C#] Fix commit record pointer offset calculation (#912)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Solodov <asolodov@b2broker.com>
  • Loading branch information
asolodov and Alexander Solodov authored Apr 16, 2024
1 parent 281bdff commit dc4bc1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cs/src/core/FasterLog/FasterLogIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public unsafe bool GetNext(MemoryPool<byte> pool, out IMemoryOwner<byte> entry,
if (isCommitRecord)
{
FasterLogRecoveryInfo info = new();
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte *)physicalAddress, entryLength)));
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte*) (headerSize + physicalAddress), entryLength)));
if (info.CommitNum != long.MaxValue) continue;

// Otherwise, no more entries
Expand Down Expand Up @@ -442,7 +442,7 @@ public unsafe bool TryConsumeNext<T>(T consumer) where T : ILogEntryConsumer
if (isCommitRecord)
{
FasterLogRecoveryInfo info = new();
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte *)physicalAddress, entryLength)));
info.Initialize(new BinaryReader(new UnmanagedMemoryStream((byte*) (headerSize + physicalAddress), entryLength)));
if (info.CommitNum != long.MaxValue) continue;

// Otherwise, no more entries
Expand Down

0 comments on commit dc4bc1d

Please sign in to comment.