Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqe2l-0002de-J2 for pgsql-general@arkaria.postgresql.org; Fri, 17 Aug 2018 12:39:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqe2j-00038o-E2 for pgsql-general@arkaria.postgresql.org; Fri, 17 Aug 2018 12:39:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqe2j-00037f-5e for pgsql-general@lists.postgresql.org; Fri, 17 Aug 2018 12:39:53 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqe2f-0005cu-M4 for pgsql-general@lists.postgresql.org; Fri, 17 Aug 2018 12:39:52 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 0171F5F79C; Fri, 17 Aug 2018 08:39:47 -0400 (EDT) Date: Fri, 17 Aug 2018 08:39:47 -0400 From: Stephen Frost To: PO Cc: pgsql-general@lists.postgresql.org Subject: Re: pg_upgrade (and recovery) pitfalls Message-ID: <20180817123947.GX3326@tamriel.snowman.net> References: <20180816165318.GO3326@tamriel.snowman.net> <20180817104556.Horde.ky2YXizEzBxNJlFxf2u3Am8@nextcloud.pro-open.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NN9opVal9nSduP+I" Content-Disposition: inline In-Reply-To: <20180817104556.Horde.ky2YXizEzBxNJlFxf2u3Am8@nextcloud.pro-open.de> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --NN9opVal9nSduP+I Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * PO (gunnar.bluth@pro-open.de) wrote: > Stephen Frost =E2=80=93 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 reac= hable > > 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... > >=20 > > 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. > >=20 > > 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. >=20 > Fair enough, and I onl=C3=B6y just realised I've been carrying a=20 > recovery_target_timeline =3D '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 --NN9opVal9nSduP+I Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJbdsITAAoJEO1sijiDR2RV8JUP+wZY+js/yL4tEb6HTIvS7zAD YE+0WEpm1JbDKPiRuqisrrUcEumXDc/WP4O9neAEKFJSGXKme+zqOcNE+cEDfKxu w41SwsLaKfCseIIvlS3NoqwrU1J+o/UNvQYBbbuUEnt+zB50ZvnNiI/fbmiOJlWW hW3YhbExG0o9yCnvDBdsLywHtXxSakIiOn0T/zyHf8wPbSKrsRB+B8qfzTToiLib lI5+OCI3wV59ubuayx0yRIjOMnjqsJ8Hw4rconf6urLg8C04hF2ihdoKI30KJkRI kb2PKxiXzGHZBPnf53E2n/hSBl+/ZRaRFhcd864nSVbpjrCxR5iK4tQst97GRxJC 75O3ZsiiNhzMSCxCx9zPJtIEEhbsx92qmuwe8l4/vwdKrZ1+a8bMlsMKWKYS7Tou +u8awYV+2FvR/ptusaqZ+tgmwDqQO5+d6DHehL3UItMibu4+igdwV90tqB2cC/aS DGJFoY1zPJCLk+BoYJSCJi38VgpTuAXpDw24sqv4jH1/uxfQU5DwZ5DnM7kr7WuN 3dIuEydpqDrMi6xAUwO5I1X7FZk6HceYeJWJloRvrTSa65ghQeH6ETeKSnElL7bE GyBi+W5OQKbrcqrj8KbiJloyHW/kwxRuPAGnBxYw6zsqU2hqoLrL0fYl8A5jjsFf SSeStHB9KL0/Fps6qmBd =3Giq -----END PGP SIGNATURE----- --NN9opVal9nSduP+I--