Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sC2Ed-002mEp-3n for pgsql-admin@arkaria.postgresql.org; Tue, 28 May 2024 19:11:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sC2Ec-00BQWp-Oc for pgsql-admin@arkaria.postgresql.org; Tue, 28 May 2024 19:11:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sC2Ec-00BQWh-D2 for pgsql-admin@lists.postgresql.org; Tue, 28 May 2024 19:11:46 +0000 Received: from truschnigg.info ([89.163.150.210]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sC2EU-001DnR-UZ for pgsql-admin@lists.postgresql.org; Tue, 28 May 2024 19:11:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=truschnigg.info; s=m22; t=1716923498; bh=2dn1cPm8zeyTUNqp/HhDROgUQZ0YdI62vp5EA39XovQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bCB48FMyyr2InV5qcG1C4Na8oU7yHZpKdNASnRu6wm8LtMwaJXnlEnVTLtYn/KTY0 O8NTfXydXzykoUF3g6EXDXL4vmSoHkB9uIDJkYQSox2JbLxAWq7918ce4gbuV51lUB FGCeY/4qgco3k8heNqF4j6SYqUwkMwcOhoBfbMaQUoS1cYKLf/nscRnVWEHsE5YZ/+ 8CPA98tOP/T/JI2C6IvMwxdUJ4UbX0ZAMgdRS6bk65er8oFmchzf4FEU7ASZK/tWm8 7U66v318us8ygbJh8gdSTvo8neXImd0tN7I7cA7zJzRmgqcNqIbiCSOSYl+lsxmZcq NKJCMC6pQPTvg== Received: from vault.lan (unknown [IPv6:2a02:1748:fafe:cf3f:1eb7:2cff:fe02:8261]) by truschnigg.info (Postfix) with ESMTPSA id C8E9420149; Tue, 28 May 2024 19:11:37 +0000 (UTC) Date: Tue, 28 May 2024 21:11:36 +0200 From: Johannes Truschnigg To: Mohan NBSPS Cc: pgsql-admin@lists.postgresql.org Subject: Re: Postgresql 9.5: Streaming Replication: Secondaries Fail To Start Post WAL Error Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LyhJ0vIsPTr8jlHA" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --LyhJ0vIsPTr8jlHA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2024 at 03:00:23PM -0400, Mohan NBSPS wrote: > [...] > Thank you Johannes for the advice. >=20 > We are looking at moving to 16. > We did not implement slots to avoid disk space issues on primary (possible > network disconnect may fill up primary `pg_xlog`). Yes, replication slots can interrupt your primary. Relying on wal_keep_segments alone can kill your replicas. Having a WAL archive can be the best of both worlds, but also needs careful monitoring and management. > We have changed the WAL settings to retain more WAL files. >=20 > Since we have not seen this issue before, (have been running postgresql f= or > over 10 years), what kind > of scenario would trigger this ? Every time you interrupt the replication stream (such as when a replica reboots, or its postgres master process is stopped), you enter a race condition between WAL segments accumulating on the primary, and the replication stream to pick up again once the replica is up once more. So if, during your replica restart, enough WAL was produced to exceed wal_keep_segments, the lineage is broken, and the replica cannot ever catch= up again. Also, the "invalid resource manager" log line you reported *might* hint at data corruption in your WAL segments. I think that data checksums and WAL compression could both make detection of such conditions more reliable. --=20 with best regards: - Johannes Truschnigg ( johannes@truschnigg.info ) www: https://johannes.truschnigg.info/ --LyhJ0vIsPTr8jlHA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEGu9IhkI+7/aKLUWF95W3jMsYfLUFAmZWLGgACgkQ95W3jMsY fLUhrA//fmRHoyleEZZ7uvpu9fU1GMPnbIOr9Wbvb6QIIrOItI5bOL9vG0PTtPbu XcMXYHL3QSCPzkvU2+0wDlREBjHFllh6U43MyHRFA0D/lnWpNGq274W2WdxTmURa kJRMWgbG/MVey9OdkUhs18NgLvuw0IzpMm26FSMRA2DFQX3onPyO4SX20HvOEz7q IwP2LJmHhPYUcf4EBr3TwCchs8RIgR1o2jqWrGBri35qsovKHn0jbavkBmCQoWov Ftu8WbrhxrzMzy8Ril2gKLyUywFS9mkSfhqgV+SGyoSWy09EF032gMeY0k+9D1/8 Iancy+K5Jf97zpMBATm0u3F/ctBSQD33iu0y+xH1ZRtFtqexm3eeZtWPAowE/Fq+ bwXGjYt1yDrJfiJ9z6IsZRrqZJ8FIXPfU1p11uVuol1edPCoQzqUqVKic/VdT9ws tcoRjzbKr+3+CG0KVjVsZgLS97XMq2DZ1f/5yr4C+lIu6aapixlg2iUjhblLBgnM hJ90D/pyM+UdeK1jh1EN9aDZdVVnVug9i2ZDmwevIbj8vZN11qEEOrrCbie8YrXV pWYJmOhFbUkc/qS/iWQTx+8aujBHzI+4NyQVnwJPA9nTue/lHvi4w+IRpcwIt80n wlEpCEaJ5HDGJW7Di25kK6n2vs2gSrOsUPOrvKRbKltFblBqXjo= =Y44W -----END PGP SIGNATURE----- --LyhJ0vIsPTr8jlHA--