On Fri, 2022-04-29 at 10:46 +0530, Bharath Rupireddy wrote: > It's not just the flush ptr, without no wait mode, the functions > would > wait if start/input lsn is, say current flush lsn - 1 or 2 or more > (before the previous record) bytes. If the functions were to wait, by > how much time should they wait? a timeout? forever?
I see, you're talking about the case of XLogFindNextRecord(), not XLogReadRecord(). XLogFindNextRecord() is the only way to align the user-provided start LSN on a valid record, but that calls XLogReadRecord(), which may wait indefinitely. If there were a different entry point that just did the alignment and skipped past continuation records, we could prevent it from trying to read the next record if we are already at the flush pointer. But without some tweak to that API, nowait is still needed. Committed your v3 patch with minor modifications. Regards, Jeff Davis