-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C#] Support FasterLog scan from different process #333
Conversation
* Add option in FasterLogSettings for ReadOnlyMode
I think there might be an issue. I'm getting an Access Violation when running a separate reader in an aggressive loop.
|
Okay, we'll take a look. Any changes made to the sample that cause it? |
The sample uses very small page sizes and segment sizes, btw for simplicity. For performance, we need to bump those up. |
I think i'm running over some limit, it fails when |
currentAddress has become > _headAddress in GetNextInternal. if (currentAddress < _headAddress)
{
if (BufferAndLoad(currentAddress, _currentPage, _currentFrame, _headAddress))
continue;
physicalAddress = frame.GetPhysicalAddress(_currentFrame, _currentOffset);
}
else
{ // this branch here fires just before the crash. 👈👈
physicalAddress = allocator.GetPhysicalAddress(currentAddress);
}
// Get and check entry length
entryLength = fasterLog.GetLength((byte*)physicalAddress); //<-- physicalAddress = 0 here 💣 👈👈 |
Make sure the log settings for the writer and reader are identical, wrt page size, segment size. |
Argh. This line is wrong: allocator.HeadAddress = int.MaxValue; It should be: allocator.HeadAddress = long.MaxValue; That explains the issue. |
Ah, cool. I patched that in my copy, it seems to work past 2GB of writes now. |
Perf looks decent too with default settings. |
On an unrelated note, Looking at If the |
You are exactly right. It's a buffer address that is valid while you hold the epoch. That's the only reason we copy it out. |
Also, with only ONE thread doing the iteration, we do know that the physical address is stable until their next GetNext call. But it's unclear how to safely expose this capability to users as a zero copy. |
AzureStorageDevice
, the enqueuing/committing process and the consuming process may be on different machines, and approximately emulates Kafka/EventHubs behavior.Sample usage: here
Inline sample:
Fix #332