Skip to content
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

FasterLog.CommitAsync will missing iterator offset if iterator does not call CompleteUntil before #915

Open
cocosip opened this issue Apr 25, 2024 · 0 comments

Comments

@cocosip
Copy link

cocosip commented Apr 25, 2024

using var iter = log.Scan(0, long.MaxValue, "foo", recover: true);
while (iter.GetNext(out var result, out var length, out var currentAddress, out nextAddress))
{
    // THIS WAITASYNC BELOW HANGS
    if (await iter.WaitAsync())
    {
        Console.WriteLine("read data currentAddress:{0}, nextAddress :{1}, content:{2}", currentAddress, nextAddress, Encoding.UTF8.GetString(result));
      //iter.CompleteUntil(nextAddress)
       await iter.CompleteUntilRecordAtAsync(currentAddress);
    }
}
 await log.CommitAsync();

If not call iter.CompleteUntil or iter.CompleteUntilRecordAtAsync , the iterator offset will missing when after next restart.
How can i ensure CompleteUntilRecordAtAsync/CompleteUntil has called?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant