From: Stephen Frost <sfrost@snowman.net>
To: PO <gunnar.bluth@pro-open.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pg_upgrade (and recovery) pitfalls
Date: Fri, 17 Aug 2018 08:39:47 -0400
Message-ID: <20180817123947.GX3326@tamriel.snowman.net> (raw)
In-Reply-To: <20180817104556.Horde.ky2YXizEzBxNJlFxf2u3Am8@nextcloud.pro-open.de>
References: <20180816165318.GO3326@tamriel.snowman.net>
<20180817104556.Horde.ky2YXizEzBxNJlFxf2u3Am8@nextcloud.pro-open.de>
Greetings,
* PO (gunnar.bluth@pro-open.de) wrote:
> Stephen Frost – Thu, 16. August 2018 19:00
> > * PO (gunnar.bluth@pro-open.de) wrote:
> > > - why does a recovery, based on a recovery.conf that points to a reachable
> > primary (which obviously communicates its own timeline), still look for higher
> > timelines' history-files in the archive and tries to jump onto these
> > timelines? This doesn't seem reasoable to me at all...
> >
> > PG is going to start from the current timeline and try to find all the
> > timelines that it could possibly play forward to and at what point the
> > timeline changes were done and then it's going to figure out which
> > timeline to go to (by default we try to stick with the currnet timeline,
> > but you can configure recovery.conf to specify a different timeline or
> > 'latest') and then it's going to request the WAL to get from where PG is
> > to the end of whichever timeline it thinks you want. That's all
> > entirely reasonable and how things are supposed to work.
> >
> > Only once PG reaches the end up what's available through the restore
> > command does it start trying to talk to the primary. There's been some
> > discussion about how it might be nice to be able to configure PG to
> > prefer going to the primary instead, though, really, it should typically
> > be faster to replay WAL from a restore_command than to get it from the
> > primary over the network, not to mention that getting it from the
> > primary will introduce some additional load on the system.
>
> Fair enough, and I onlöy just realised I've been carrying a
> recovery_target_timeline = 'latest'
> around from my predecessors. :facepalm:
That isn't necessairly a bad thing to have, especially in environments
where you're promoting replicas to be primaries and flipping things
around.
> I owe you a beer or X (in Lisbon?)!
Yes, I'll be in Lisbon, would be happy to chat over a beer.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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: sfrost@snowman.net, gunnar.bluth@pro-open.de
Subject: Re: pg_upgrade (and recovery) pitfalls
In-Reply-To: <20180817123947.GX3326@tamriel.snowman.net>
References: <20180816165318.GO3326@tamriel.snowman.net> <20180817104556.Horde.ky2YXizEzBxNJlFxf2u3Am8@nextcloud.pro-open.de> <20180817123947.GX3326@tamriel.snowman.net>
* 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