Re: Make mesage at end-of-recovery less scary. - Mailing list pgsql-hackers

From Ashutosh Sharma
Subject Re: Make mesage at end-of-recovery less scary.
Date
Msg-id CAE9k0P=mODNt__x=bY3KurZb4FcPuWa7DVynoykEnWms0S8Rzg@mail.gmail.com
Whole thread Raw
In response to Re: Make mesage at end-of-recovery less scary.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Make mesage at end-of-recovery less scary.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
On Thu, Feb 17, 2022 at 1:20 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Tue, 15 Feb 2022 20:17:20 +0530, Ashutosh Sharma <ashu.coek88@gmail.com> wrote in
> > OK. The v13 patch looks good. I have marked it as ready to commit.
> > Thank you for working on all my review comments.
>
> Thaks! But the recent xlog.c refactoring crashes into this patch.
> And I found a silly bug while rebasing.
>
> xlog.c:12463 / xlogrecovery.c:3168
>                 if (!WaitForWALToBecomeAvailable(targetPagePtr + reqLen,
> ..
> {
> +                       Assert(!StandbyMode);
> ...
> +                       xlogreader->EndOfWAL = true;
>
> Yeah, I forgot about promotion there..

Yes, we exit WaitForWALToBecomeAvailable() even in standby mode
provided the user has requested for the promotion. So checking for the
!StandbyMode condition alone was not enough.

So what I should have done is
> setting EndOfWAL according to StandbyMode.
>
> +                       Assert(!StandbyMode || CheckForStandbyTrigger());
> ...
> +                       /* promotion exit is not end-of-WAL */
> +                       xlogreader->EndOfWAL = !StandbyMode;
>

The changes looks good. thanks.!

--
With Regards,
Ashutosh Sharma.



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Timeout control within tests
Next
From: Ashutosh Sharma
Date:
Subject: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file