Re: XLogBeginRead's header comment lies

2022-08-18 Thread Robert Haas
On Wed, Aug 17, 2022 at 10:57 AM Robert Haas wrote: > Yeah, that looks right to me. I'm inclined to commit your patch with > some changes to wording of the comments. I'm also inclined not to > back-patch, since we don't know that this breaks anything for existing > users of the xlogreader facility

Re: XLogBeginRead's header comment lies

2022-08-17 Thread Robert Haas
On Wed, Aug 17, 2022 at 6:53 AM Dilip Kumar wrote: > Thinking again, there is already a code in XLogDecodeNextRecord() to > error out if XLP_FIRST_IS_CONTRECORD is set so probably we don't need > to do anything else and the previous patch with modified assert should > just work fine? Yeah, that l

Re: XLogBeginRead's header comment lies

2022-08-17 Thread Dilip Kumar
On Wed, Aug 17, 2022 at 11:31 AM Dilip Kumar wrote: > > On Wed, Aug 17, 2022 at 11:18 AM Dilip Kumar wrote: > > > > On Tue, Aug 16, 2022 at 11:28 PM Robert Haas wrote: > > > > > > > Yeah I think it makes sense to make it work as per the comment in > > XLogBeginRecord(). I think if we modify the

Re: XLogBeginRead's header comment lies

2022-08-16 Thread Dilip Kumar
On Wed, Aug 17, 2022 at 11:18 AM Dilip Kumar wrote: > > On Tue, Aug 16, 2022 at 11:28 PM Robert Haas wrote: > > > > Yeah I think it makes sense to make it work as per the comment in > XLogBeginRecord(). I think if we modify the Assert as per the comment > of XLogBeginRecord() then the remaining

Re: XLogBeginRead's header comment lies

2022-08-16 Thread Dilip Kumar
On Tue, Aug 16, 2022 at 11:28 PM Robert Haas wrote: > > It claims that: > > * 'RecPtr' should point to the beginning of a valid WAL record. Pointing at > * the beginning of a page is also OK, if there is a new record right after > * the page header, i.e. not a continuation. > > But this actual

Re: XLogBeginRead's header comment lies

2022-08-16 Thread Robert Haas
Forgot the attachment. waldump-beginread.patch Description: Binary data

XLogBeginRead's header comment lies

2022-08-16 Thread Robert Haas
It claims that: * 'RecPtr' should point to the beginning of a valid WAL record. Pointing at * the beginning of a page is also OK, if there is a new record right after * the page header, i.e. not a continuation. But this actually doesn't seem to work. This function doesn't itself have any prob