#915·FASTER

如果迭代器在提交之前没有调用 CompleteUntil,则 FasterLog.CommitAsync 将丢失迭代器偏移量

作者: cocosip创建于 2024年4月25日更新于 2025年10月1日

```c# 使用 var iter = log.Scan(0, long.MaxValue, "foo", recover: true); while (iter.GetNext(out var result, out var length, out var currentAddress, out nextAddress)) { // 以下的 WaitAsync 会卡死 if (await iter.WaitAsync()) { Console.WriteLine("读取数据 currentAddress:{0}, nextAddress :{1}, content:{2}", currentAddress, nextAddress, Encoding.UTF8.GetString(result)); //iter.CompleteUntil(nextAddress) await iter.CompleteUntilRecordAtAsync(currentAddress); } } await log.CommitAsync(); 如果不调用 iter.CompleteUntil 或 iter.CompleteUntilRecordAtAsync,在下次重启后,迭代器偏移量将丢失。如何确保 CompleteUntilRecordAtAsync/CompleteUntil 已经调用?

内容来源: microsoft/FASTER