Re: BUG #15346: Replica fails to start after the crash

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: cyberdemn(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org, alvherre(at)2ndquadrant(dot)com, 9erthalion6(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15346: Replica fails to start after the crash
Date: 2018-08-31 06:23:54
Message-ID: 20180831062354.GK15446@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Fri, Aug 31, 2018 at 02:52:06PM +0900, Kyotaro HORIGUCHI wrote:
> The patch inhibits turning off updateMinRecoveryPoint on other
> than the startup process running crash-recovery except at the end
> of XLogNeedsFlush.

Yes that's a matter of safety, as I put into the truck any modules which
may use XLogFlush(). And that maps with the old code, so there is no
more surprise.

> Even if any other processes than the startup calls the function
> during crash recovery, they don't have a means to turn on
> updateMinRecoveryPoint again. Actually the only process that
> calls the function during crash recovery is the startup. bwriter
> and checkpointer doesn't. Hot-standby backends come after
> crash-recvery ends. After all, we just won't have an invalid
> minRecoveryPoint value there, and updateMinRecoverypoint must be
> true.

Yes, until a recovery point is reached only the startup process could
call that. Now I would imagine that we could have a background worker
as well which is spawned when the postmaster starts, and calls those
code paths...

> + /*
> + * No other process than the startup doesn't reach here before crash
> + * recovery ends. So minRecoveryPoint must have a valid value here.
> + */
> + Assert(minRecoveryPoint != InvalidXLogRecPtr);

... And that would invalidate your assertion here.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ashutosh Bapat 2018-08-31 06:28:26 Re: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
Previous Message Kyotaro HORIGUCHI 2018-08-31 05:52:06 Re: BUG #15346: Replica fails to start after the crash

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-08-31 06:23:56 Re: [HACKERS] advanced partition matching algorithm for partition-wise join
Previous Message Kyotaro HORIGUCHI 2018-08-31 05:52:06 Re: BUG #15346: Replica fails to start after the crash