FasterLog.CommitAsync will missing iterator offset if iterator does not call CompleteUntil before
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.6k
- Forks
- 595
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Scan iterator flow shown in the reproduction, focusing on GetNext, WaitAsync, CompleteUntil, CompleteUntilRecordAtAsync, and CommitAsync. Reproduce the restart scenario and trace whether the iterator offset is persisted when completion is omitted; done means the behavior and expected way to ensure completion are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100