pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: cyberdemn@gmail.com
Cc: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com
Cc: 9erthalion6@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15346: Replica fails to start after the crash
Date: Thu, 30 Aug 2018 23:23:54 -0700
Message-ID: <20180831062354.GK15446@paquier.xyz> (raw)
In-Reply-To: <20180831.145206.05203037.horiguchi.kyotaro@lab.ntt.co.jp>
References: <20180830185705.GF15446@paquier.xyz>
	<20180831.094846.52751456.horiguchi.kyotaro@lab.ntt.co.jp>
	<20180831014855.GJ15446@paquier.xyz>
	<20180831.145206.05203037.horiguchi.kyotaro@lab.ntt.co.jp>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (35+ messages)  latest in thread

Message-ID: <20180831062354.GK15446@paquier.xyz>
Permalink:  ../20180831062354.GK15446@paquier.xyz/
Also on:    postgresql.org/message-id/20180831062354.GK15446@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, horiguchi.kyotaro@lab.ntt.co.jp, cyberdemn@gmail.com, pgsql-hackers@postgresql.org, alvherre@2ndquadrant.com, 9erthalion6@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15346: Replica fails to start after the crash
  In-Reply-To: <20180831062354.GK15446@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox