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 1fozFZ-0000iw-CG for pgsql-general@arkaria.postgresql.org; Sun, 12 Aug 2018 22:54:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fozFW-0002S8-VX for pgsql-general@arkaria.postgresql.org; Sun, 12 Aug 2018 22:54:14 +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 1fozFT-00025h-15 for pgsql-general@lists.postgresql.org; Sun, 12 Aug 2018 22:54:11 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fozFP-0004eV-GQ for pgsql-general@lists.postgresql.org; Sun, 12 Aug 2018 22:54:09 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id AB68E5F79C; Sun, 12 Aug 2018 18:54:06 -0400 (EDT) Date: Sun, 12 Aug 2018 18:54:06 -0400 From: Stephen Frost To: Phil Endecott Cc: pgsql-general@lists.postgresql.org Subject: Re: Replication failure, slave requesting old segments Message-ID: <20180812225406.GX3326@tamriel.snowman.net> References: <20180812212953.GU3326@tamriel.snowman.net> <1534110785010@dmwebmail.dmwebmail.chezphil.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FhvelBhrd33NvMcY" Content-Disposition: inline In-Reply-To: <1534110785010@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 --FhvelBhrd33NvMcY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Phil Endecott (spam_from_pgsql_lists@chezphil.org) wrote: > OK. I think this is perhaps a documentation bug, maybe a missing=20 > warning when the master reads its configuration, and maybe (as you say)= =20 > a bad default value. If we consider it to be an issue worthy of a change then we should probably just change the default value, and maybe not even allow it to be set lower than '1'. > Specifically, section 26.2.5 of the docs says: >=20 > "If you use streaming replication without file-based continuous archiving= ,=20 > the server might recycle old WAL segments before the standby has received= =20 > them. If this occurs, the standby will need to be reinitialized from a ne= w=20 > base backup. You can avoid this by setting wal_keep_segments to a value= =20 > large enough to ensure that WAL segments are not recycled too early, or b= y=20 > configuring a replication slot for the standby. If you set up a WAL archi= ve=20 > that's accessible from the standby, these solutions are not required, sin= ce=20 > the standby can always use the archive to catch up provided it retains en= ough=20 > segments." >=20 > OR, maybe the WAL reader that process the files that restore_command fetc= hes=20 > could be smart enough to realise that it can skip over the gap at the end? That strikes me as a whole lot more complication in something we'd rather not introduce additional complications into without very good reason. Then again, there was just a nearby discussion about how it'd be nice if the backend could realize when a WAL file is complete, and I do think that'll be more of an issue when users start configuring larger WAL files, so perhaps we should figure out a way to handle this.. > Anyway. Do others agree that my issue was the result of wal_keep_segment= s=3D0 ? Yeah, I've not spent much time actually looking at code around this, so it'd be nice to get: a) a reproducible case demonstrating it's happening b) testing to see how long it's been this way c) if setting wal_keep_segments=3D1 fixes it d) perhaps some thought around if we could address this some other way Thanks! Stephen --FhvelBhrd33NvMcY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJbcLqOAAoJEO1sijiDR2RVEYgP/3rQA7qd3pWXxw7wwYP6JUdV Zn88JL+7wAfNczjObLZdDiyrU4eTiKzZl2rhMpx7YypV0Tjj6iRuX7lkmk5CCFnj WOfKvUGV5jDzZtH8tmo4Bkz4boGhk1kMWlcFh4JM0vaRTWKhFTrqHFBx1mkaCWj9 GvHQalgRSw36Bp8rg6mv3eprJlWCScCOlPeKnwCLJ9B9Pmmxzy/Vt91TIguvc7Cp IF7iQu9x1qhnpCyvSmhGW+L75ai4P+YAO1y5pNgYq6+MuGXDQ34lFVCWW3t2OiBt 0WwGOWn008CldJYLb9BD0i4Iua8fEvBQPVaIzODJ9MrWMfQTGg7T1IzUbNRY3DRX V9tjsykNNwRgGdaVRa1EoHYemFe5aYaYR+vi920ES9IHRUHHfUPL7bZXPL9opeiI 8jm2PxVsPndYoyev86YEHra3Si84w4V3D82NEmQQBFa9udErM684LpH8Ju5u8/o0 Si7BfWhcccMAbUCpCO1wGhQTAuCi1+26NAZlcOTBy+VYsRuMCccZhmqnh2H++9y2 d28MENrfMKLlIN4Pwbd+E4YbAc+IXGzI4CE0T1ZPrqtxX9hMTZppQkHT2Aev+wfM FvznZRZFpdsl+pZO4P+KWYm1W4spGmib2xfcZFyv77FiAqmFkslwIxcEhagiESXH 1SSYWmSzbFdMUS1Z/9gh =IEbn -----END PGP SIGNATURE----- --FhvelBhrd33NvMcY--