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 1fpDZh-0001uE-MY for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 14:12:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpDZf-0007Vx-LM for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 14:11:59 +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 1fpDZf-0007Vq-D4 for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 14:11:59 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpDZb-0007F7-Lh for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 14:11:58 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 5D4CD5F79C; Mon, 13 Aug 2018 10:11:54 -0400 (EDT) Date: Mon, 13 Aug 2018 10:11:54 -0400 From: Stephen Frost To: Adrian Klaver Cc: Phil Endecott , pgsql-general@lists.postgresql.org Subject: Re: Replication failure, slave requesting old segments Message-ID: <20180813141154.GM3326@tamriel.snowman.net> References: <31ba3812-6a0a-4639-5386-e804e59bc322@aklaver.com> <1534162092902@dmwebmail.dmwebmail.chezphil.org> <07fbb899-570d-ccf2-a4ad-11d6cc295ed3@aklaver.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5ch3vXimoUl90IHM" Content-Disposition: inline In-Reply-To: <07fbb899-570d-ccf2-a4ad-11d6cc295ed3@aklaver.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5ch3vXimoUl90IHM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Adrian Klaver (adrian.klaver@aklaver.com) wrote: > On 08/13/2018 05:08 AM, Phil Endecott wrote: > >Adrian Klaver wrote: > >Really?=A0 I thought the intention was that the system should be > >able to recover reliably when the slave reconnects after a > >period of downtime, subject only to there being sufficient > >network/CPU/disk bandwidth etc. for it to eventually catch up. That's correct. > See also my reply to Stephen earlier. Basically you are trying to coordin= ate > two different operations. They start from the same source pg_xlog(pg_wal > 10+) but arrive on a different time scale and from different locations. > Without sufficient sanity checks it is possible they diverge enough on one > or both paths to render the process unstable. This isn't what's happening. We're not talking about a timeline change here or a replica being promoted to be a primary in general. There's no diverging happening- it's the same consistent WAL stream, just coming =66rom two different sources, which PG is specifically designed to handle and should be handling seamlessly. > I would say that: >=20 > "If you set up a WAL archive that's accessible from the standby, these > solutions are not required, since the standby can always use the archive = to > catch up provided it retains enough segments." >=20 > should be more like: >=20 > "If you set up a WAL archive that's accessible from the standby, these > solutions are not required, since the standby can always use the archive = to > catch up provided it retains enough segments. *This is dependent on > verification that the archiving is working properly. A belt and suspenders > approach would be to set wal_keep_segments to a value > 0 in the event > archiving is not properly functioning*" > " I don't think I can disagree more with this additional wording, and I *really* don't think we should be encouraging people to set a high wal_keep_segments. The specific case here looks like it just need to be set to, exactly, '1', to ensure that the primary hasn't removed the last WAL file that it archived. Thanks! Stephen --5ch3vXimoUl90IHM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJbcZGqAAoJEO1sijiDR2RVQ40P/3nsHwl+YD+bguOqR+nxZRYx WY4b84lAVFuWO4NOS29hKjG8ecZZm50kgSc3k96Ki3MvKzwca8C7PtV0D7P9xMRb 4SoIs6aY6W0z710WNEtYd2ikomoZZg5eqaYA+Z28xuctJ9aYtSD3WmALO7HLpmCm nI17OV58aWSCDYthcjCYfvoQvDx2Bb+nbqwLBMNNgT7+8aCwAjC4Ph7AuoFp9Xv6 PP0NIoVU8xgl7al2BGSRrmGeapXoP+KidjsHot502g1ohnsuGhHZ+rD/0goCYOPv 1wPDNXVkPwDBAPce4VmAVLFkYqdb8KZFppMCUqvqWM7ti4+YxBLX2gH3uW22Z9I9 7MZx7CZFd2nJcAK5cFULDQki2bas/ZZ60tSLzMH2VsTyKDILeI11VrdgZzn9E6U5 g4XSAQdzcOeABWP/74C3X3mVC1a+AarZMYWFIeZNroXIUpLKtwprUBy7eELomS3D OieY6tJhAiIglqsB3yrJ6kJqTNwJ7ueZeB7+NMSiDxvJD6pXtIrpMdgBJzpjSleI srEYCoio6XiikSFJs1ClBSQxD0mYSVjBqkhv0tF5bnIEi5ie2+zEYUoBsJW8c4uG 9GXzXc78YSp90/m9MFEHrT/A5QSDVvtSe4aCn02Guc1yIdZGXNRmuA0VoRShtVma ZOQvqOnTSKX4mPnA1Z2q =u5oE -----END PGP SIGNATURE----- --5ch3vXimoUl90IHM--