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 1fpC82-0005Pv-7Y for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 12:39:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpC7z-0002lh-De for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 12:39:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpC7z-0002lV-2I for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 12:39:19 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpC7w-000216-6m for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 12:39:17 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 955F65F79C; Mon, 13 Aug 2018 08:39:15 -0400 (EDT) Date: Mon, 13 Aug 2018 08:39:15 -0400 From: Stephen Frost To: Phil Endecott Cc: pgsql-general@lists.postgresql.org, Adrian Klaver Subject: Re: Replication failure, slave requesting old segments Message-ID: <20180813123915.GD3326@tamriel.snowman.net> References: <31ba3812-6a0a-4639-5386-e804e59bc322@aklaver.com> <1534162092902@dmwebmail.dmwebmail.chezphil.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rWTGJt96jR0TCFDW" Content-Disposition: inline In-Reply-To: <1534162092902@dmwebmail.dmwebmail.chezphil.org> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --rWTGJt96jR0TCFDW Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Phil Endecott (spam_from_pgsql_lists@chezphil.org) wrote: > Adrian Klaver wrote: > >On 08/12/2018 02:56 PM, Phil Endecott wrote: > >>Anyway.=A0 Do others agree that my issue was the result of > >>wal_keep_segments=3D0 ? > > > >Only as a sub-issue of the slave losing contact with the master. The bas= ic > >problem is maintaining two separate operations, archiving and streaming, > >in sync. If either or some combination of both lose synchronization then > >it is anyone's guess on what is appropriate for wal_keep_segments. Uh, no, having an archive_command and a restore_command configures exactly should remove the need to worry about what wal_keep_segments is set to because anything not on the primary really should be available through what's been archived and PG shouldn't have any trouble figuring that out and working with it. If all you've got is streaming replication then, sure, you have no idea what to set wal_keep_segments to because the replica could be offline for an indeterminate amount of time, but as long as you're keeping track of all the WAL through archive_command, that shouldn't be an issue. > Really? 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. Yes, that's correct, the replica should always be able to catch back up presuming there's no gaps in the WAL between when the replica failed and where the primary is at. Thanks! Stephen --rWTGJt96jR0TCFDW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJbcXvzAAoJEO1sijiDR2RVrKMQALxomSOSqOuLc1c0cs2iy2ez Ztyb3Yv6sZJTWQ0gZoUtAlNWr72FGwFpZ0r7sZ+RxGldF5vRMwyUvDTG58U34Q7v NNvh1Epm2jJ5TkyP5gAic5LOFFGJcwfI8JtxDK94+TukbR3GUhpaWUMlYxUCvjgb wofrtG25FkFgxeJnieycJMJF+MJwLPqz3jRuWjedWxzISXXpU4JFFz3iJWVE5cxN 9AKD+17ETiWqRJkWgdhn+KCwuzlrmZNu8ZEf7Huy0lDKfI7TqQGFYuSvmXgvLQqu 6lMcEb3QeM6HlrepJkZb6nRnodj0g4GJ0NLiHf99949I008//T7JoLO4U8byr98C oGqtokFCZv3m40128mfu69VXdMZ5g2MaqHoBkw6j1PVUXIzteobAxmKAD8P/bLVH T2Gks8fom4gFqvaDpCfTlRySMOiB2jD9C1VJS+MFixKjPIXZbLQUl4KJ4lJLSOu3 LFv/rFX3v/DqgpBlSUcDFN8Whe6CViHhedvXXPjfoabL3cqOxS+hztt/fBuFqWlv sC0hLCa08/+gbsYhEO5o/7HPLjejGnWGtPt2A6Qc8QFUuzgF2Jc8UbBFIX69WJi9 ee3VBxt0HPY+0kT4ma/KZT+T+kzWSf2WR4ZgTmdtfQksru/XO+UDHyra0eipwXZU 0zHrkZKgJHCZyNLWGmql =a9dv -----END PGP SIGNATURE----- --rWTGJt96jR0TCFDW--