Re: XLogBeginRead's header comment lies - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: XLogBeginRead's header comment lies
Date
Msg-id CAFiTN-sCGjU6fbspPmdjhikNbAWuPSS-Y62Ea7p8253c4wrbAw@mail.gmail.com
Whole thread Raw
In response to Re: XLogBeginRead's header comment lies  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: XLogBeginRead's header comment lies
List pgsql-hackers
On Wed, Aug 17, 2022 at 11:18 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> On Tue, Aug 16, 2022 at 11:28 PM Robert Haas <robertmhaas@gmail.com> 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 code of the
> XLogDecodeNextRecord() is capable enough to take care of skipping the
> page header if we are pointing at the beginning of the block.
>
> See attached patch.
>

I think that is not sufficient, if there is a record continuing from
the previous page and we are pointing to the start of the page then
this assertion is not sufficient.  I think if the
targetRecOff is zero then we should additionally read the header and
verify that XLP_FIRST_IS_CONTRECORD is not set.

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Materialized view rewrite is broken when there is an event trigger
Next
From: Michael Paquier
Date:
Subject: Re: Assertion failure on PG15 with modified test_shm_mq test