Re: Recovery from WAL archives not advancing timeline?

From: Don Seiler <don(at)seiler(dot)us>
To: Rui DeSousa <rui(at)crazybean(dot)net>
Cc: Ian Lawrence Barwick <barwick(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Recovery from WAL archives not advancing timeline?
Date: 2020-08-11 00:58:13
Message-ID: CAHJZqBC9o+v5kiXwVtzc+aPH_fQNmFZH+oQ3gwV2Hxf6BgOuaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Aug 10, 2020 at 7:23 PM Rui DeSousa <rui(at)crazybean(dot)net> wrote:

>
>
> On Aug 10, 2020, at 8:03 PM, Rui DeSousa <rui(at)crazybean(dot)net> wrote:
>
>
>
> On Aug 10, 2020, at 4:28 PM, Don Seiler <don(at)seiler(dot)us> wrote:
>
> I'm following up to see if anyone else would categorize this as a bug. It
> renders my old primaries dead until I do a restore on them.
>
>
> No, I don’t think so. When you promote a standby; the primary will have
> to be restored or rewinded using pg_rewind to turn it into a replica.
> Another approach is to cleanly shutdown the primary and then you can turn
> it into a replica without doing a restore or pg_rewind.
>
>
> Just to be clear if it wasn’t already self evident by my above statement:
> The primary needs to be clearly shutdown (all WALs archived), apply all
> WALs to replica, promote the replica and then the original primary can be
> turn into a replica without a restore or pg_rewind.
>

But that was the process that I did. I cleanly shutdown the primary first.
The primary write one last WAL file as part of its shutdown. That WAL file
was archived and then restored and recovered on the replica. The replica
was them promoted.

This process was the same for both streaming and non-streaming replication.
However only the streaming replica wrote a .partial WAL file on promotion
(which was then archived and used by the former primary to start recovery).
The former primary doesn't even try to follow the timeline change in the
non-streaming scenario.

Don.

--
Don Seiler
www.seiler.us

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ian Barwick 2020-08-11 01:08:23 Re: Recovery from WAL archives not advancing timeline?
Previous Message Mohammed Afsar 2020-08-11 00:31:25 Postgresql background writer and checkpointer memory utilization in Linux server