Re: Does pg_ctl promote wait for pending WAL?

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Does pg_ctl promote wait for pending WAL?
Date: 2021-01-29 06:59:26
Message-ID: 9D64B243-F9F6-4041-8B68-EFA2771E0135@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tatsuo,

> On 29. Jan, 2021, at 03:51, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)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.
>
> The motivation of this question behind is I want to have a complete
> copy of the primary server using promote command.

do I understand you correctly that you wait until there is no activity on the primary and want to promote the replica only then?

If this is the case, you should be able to safely shutdown the primary anyway at any time to be assured that the replica doesn't receive any more WAL files and is complete. Then promote the replica and restart the primary.

From then on, the replica is no replica anymore but has a life on its own with its own timeline.

Cheers,
Paul

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2021-01-29 07:24:51 Re: Does pg_ctl promote wait for pending WAL?
Previous Message Tatsuo Ishii 2021-01-29 02:51:20 Does pg_ctl promote wait for pending WAL?