On 12/15/20, 2:33 AM, "Kyotaro Horiguchi" <horikyota....@gmail.com> wrote: > You're right in that regard. There's a window where partial record is > written when write location passes F0 after insertion location passes > F1. However, remembering all spanning records seems overkilling to me.
I'm curious why you feel that recording all cross-segment records is overkill. IMO it seems far simpler to just do that rather than try to reason about all these different scenarios and rely on various (and possibly fragile) assumptions. You only need to record the end location of records that cross into the next segment (or that fit perfectly into the end of the current one) and to evaluate which segments to mark .ready as the "flushed" LSN advances. I'd expect that in most cases we wouldn't need to store more than a couple of record boundaries, so it's not like we'd normally be storing dozens of boundaries. Even if we did need to store several boundaries, AFAICT the approach I'm proposing should still work well enough. Nathan