Re: recovery_min_apply_delay in archive recovery causes assertion failure in latch

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: recovery_min_apply_delay in archive recovery causes assertion failure in latch
Date: 2019-09-30 08:50:03
Message-ID: CAHGQGwFQ=uKC161L_cgcNyC0GVrxbQzpvVbCOA6DU+b=JTi8RQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 30, 2019 at 12:42 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, Sep 30, 2019 at 12:49:03AM +0900, Fujii Masao wrote:
> > Attached patch fixes this issue by making archive recovery always ignore
> > recovery_min_apply_delay. This change is OK because
> > recovery_min_apply_delay was introduced for standby mode, I think.
> >
> > This issue is not new in v12. I observed that the issue was reproduced
> > in v11. So the back-patch is necessary.
>
> I have not directly tested, but from a lookup at the code I think
> that you are right. Perhaps we'd want more safeguards in
> WaitForWALToBecomeAvailable(), like an assert within the
> XLOG_FROM_STREAM part similar to the check you are adding? My point
> is that we should switch to XLOG_FROM_STREAM only if we are in standby
> mode, and that's the only place where the startup process looks at
> recoveryWakeupLatch.

Thanks for the review! OK, attached is the patch which also added
two assertion checks as you described.

Regards,

--
Fujii Masao

Attachment Content-Type Size
fix-assertion-failure-in-latch_v2.patch application/octet-stream 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexey Kondratov 2019-09-30 08:51:25 Re: Two pg_rewind patches (auto generate recovery conf and ensure clean shutdown)
Previous Message Ashutosh Sharma 2019-09-30 08:49:58 Re: Skip recovery/standby signal files in pg_basebackup