pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Paul Förster <paul.foerster@gmail.com>
Cc: Tatsuo Ishii <ishii@sraoss.co.jp>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Does pg_ctl promote wait for pending WAL?
Date: Fri, 29 Jan 2021 16:24:51 +0900
Message-ID: <YBO4Q3TMzSPm76k6@paquier.xyz> (raw)
In-Reply-To: <9D64B243-F9F6-4041-8B68-EFA2771E0135@gmail.com>
References: <20210129.115120.719391117505612933.t-ishii@sraoss.co.jp>
	<9D64B243-F9F6-4041-8B68-EFA2771E0135@gmail.com>

Hi Ishii-san,

On Fri, Jan 29, 2021 at 07:59:26AM +0100, Paul Förster wrote:
> On 29. Jan, 2021, at 03:51, Tatsuo Ishii <ishii@sraoss.co.jp> wrote:
>> 
>> Does anybody know whether a standby server waits for pending WAL
>> records/files while promotion is requested? I assume that no data
>> update is performed on the primary server while promotion.
>> 
>> I imagine that a standby server stops to replay WAL and promotes as
>> soon as SIGUSR1 signal is received.

To answer to your question based on the code, you can check for the
code paths calling CheckForStandbyTrigger() in xlog.c when it comes to
promotion detection in the WAL replay.  In short,
WaitForWALToBecomeAvailable() tells that after the promotion is 
detected in the startup process, then recovery would still try to
replay as much WAL as possible from the archives or pg_wal before a
failover.

Equally, from the docs:
"Before failover, any WAL immediately available in the archive or in
pg_wal will be restored, but no attempt is made to connect to the
primary."
--
Michael

Attachments:

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

view thread (4+ messages)  latest in thread

Message-ID: <YBO4Q3TMzSPm76k6@paquier.xyz>
Permalink:  ../YBO4Q3TMzSPm76k6@paquier.xyz/
Also on:    postgresql.org/message-id/YBO4Q3TMzSPm76k6@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: michael@paquier.xyz, paul.foerster@gmail.com, ishii@sraoss.co.jp
  Subject: Re: Does pg_ctl promote wait for pending WAL?
  In-Reply-To: <YBO4Q3TMzSPm76k6@paquier.xyz>
  References: <20210129.115120.719391117505612933.t-ishii@sraoss.co.jp> <9D64B243-F9F6-4041-8B68-EFA2771E0135@gmail.com> <YBO4Q3TMzSPm76k6@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