microsoft / microsoft/FASTER

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

Open
#915 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.