From: | Dilip Kumar <dilipbalaut(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com> |
Subject: | Re: pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages |
Date: | 2025-06-26 07:01:56 |
Message-ID: | CAFiTN-uHtrPE+1e_m2phKC9S8FiSeMUoRO9z0J=sdwFR=gxOJA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jun 26, 2025 at 11:47 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Jun 26, 2025 at 08:48:32AM +0530, Dilip Kumar wrote:
> > On Thu, Jun 26, 2025 at 6:22 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> >> So you are suggesting the addition of an extra ReadPageInternal() that
> >> forces a read of only the read, perform the checks on the header, then
> >> read the rest. After reading SizeOfXLogShortPHD worth of data,
> >> shouldn't the checks on xlp_rem_len be done a bit earlier than what
> >> you are proposing in this patch?
> >
> > I did not get the point, IMHO it has to be validated after the record
> > on the next page has been read.
>
> As proposed in the patch, the first ReadPageInternal() reads
> SizeOfXLogShortPHD worth of data (right?), so we should have access to
> XLogPageHeaderData.xlp_rem_len before attempting the second
> ReadPageInternal() worth Min(total_len - gotlen + SizeOfXLogShortPHD,
> XLOG_BLCKSZ) of data. The check that fails with a "invalid contrecord
> length %u" relies on xlp_rem_len, total_len, RecPtr and gotlen. We
> know all this information before the second ReadPageInternal().
Yeah you are right, this can be moved before the second
ReadPageInternal() as we have already read XLogPageHeader.
--
Regards,
Dilip Kumar
Google
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Jones | 2025-06-26 07:22:11 | Re: display hot standby state in psql prompt |
Previous Message | Tatsuo Ishii | 2025-06-26 06:56:08 | PG18 protocol version |