Re: Infinite loop in XLogPageRead() on standby

From: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: michael(at)paquier(dot)xyz, pgsql-hackers(at)postgresql(dot)org, thomas(dot)munro(at)gmail(dot)com
Subject: Re: Infinite loop in XLogPageRead() on standby
Date: 2024-03-06 10:34:29
Message-ID: CAFh8B=msY9ZcYN9eN+UVOo+1mNEBfVu454oOu6qi=fdy-7momg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kyotaro,

Oh, now I understand what you mean. Is the retry supposed to happen only
when we are reading the very first page from the WAL file?

On Wed, 6 Mar 2024 at 09:57, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
wrote:

>
> xlogrecovery.c:
> @@ -3460,8 +3490,10 @@ retry:
> * responsible for the validation.
> */
> if (StandbyMode &&
> + targetPagePtr % 0x100000 == 0 &&
> !XLogReaderValidatePageHeader(xlogreader, targetPagePtr,
> readBuf))
> {
>
>
Hmm, I think you meant to use wal_segment_size, because 0x100000 is just
1MB. As a result, currently it works for you by accident.

> Thus, I managed to reproduce precisely the same situation as you
> described utilizing your script with modifications and some core
> tweaks, and with the change above, I saw that the behavior was
> fixed. However, for reasons unclear to me, it shows another issue, and
> I am running out of time and need more caffeine. I'll continue
> investigating this tomorrow.
>

Thank you for spending your time on it!

--
Regards,
--
Alexander Kukushkin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-03-06 10:46:29 Re: pipe_read_line for reading arbitrary strings
Previous Message Dean Rasheed 2024-03-06 10:33:57 Re: Proposal to include --exclude-extension Flag in pg_dump