Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ml022-00060l-4t for pgsql-general@arkaria.postgresql.org; Thu, 11 Nov 2021 02:41:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ml021-00088z-4A for pgsql-general@arkaria.postgresql.org; Thu, 11 Nov 2021 02:41:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ml020-00088n-6C for pgsql-general@lists.postgresql.org; Thu, 11 Nov 2021 02:41:40 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ml01w-0003pD-S6 for pgsql-general@postgresql.org; Thu, 11 Nov 2021 02:41:39 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 28E6D3201628; Wed, 10 Nov 2021 21:41:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 10 Nov 2021 21:41:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=LNcdPawFOr9wojHPCOpFLyZ7QXC c7WGt9i1L9KES5HM=; b=ZHZYUVGQc2kMR7mk20xWJCVdIPLOpUQxcLuqwTlk0ds GkOxasza5+IgUf8u1Lr0+N1VVVzxBBZDB5qL8kygaECv8oqyszSiejZXaaA/bmBo jleOwxj4OjCR4G8xCA9NtC0efhH4Z8ouyk/xavf3jEEfnhRiNueVnYSSjOP50oF+ HpXYwfNu5ZysYlCYqq870M9ggTs1R/LHAnueTr8+hlzEuojsd9+Wb8snHsc8vFLU qGYMG/58YkCqBj+QS3gmxU+wjjm5JFcc1mJnz373ekNRK7ExeOSHfvEMopwAhDFW 3VUS4u+Rkesg9+Xi5SxFw5+P2DidXUpgHKvpBshZjhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=LNcdPa wFOr9wojHPCOpFLyZ7QXCc7WGt9i1L9KES5HM=; b=cBF8a41RTfy7u+Fcjv2U4n F+ZPz8K2ZXojztdaIghnviDP4SN65yihaUWeiHRBfSOs8Jpgf2bkJmZS3EVc6pGh jxir873zh90Kg9BFiUz9xxwgNBmyJjZLxuSxdHFObV4qUR5HBCjMBk1cjV68x80w rmPbM1uXvXTjQRSx2sqXqxysERjQyfpmj34chihQ7uAKKLcgh9HiN3lVQNNMeZmc mdAx3RV/MKXCiJgisj/H2C2BwRL88MnIbh3f8qE6YLoqbArksWcvVe41J8AKXQMm 5HO08K+sh4+6pUmdaNuwny9PlS+S7Y558Ib48vhABzfUJbKektURVviVKwaXwBUQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvddtgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepffdufeeflefghfekudekkeevvddu gfeiteekkeduleefvefhhffftdduffeiuedtnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Nov 2021 21:41:31 -0500 (EST) Date: Thu, 11 Nov 2021 11:41:27 +0900 From: Michael Paquier To: Rita Cc: Ben Chobot , "pgsql-general@postgresql.org >> PG-General Mailing List" Subject: Re: Pause streaming replication Message-ID: References: <476bcc51-c1e4-1fb1-24c6-07cd5f6d5d80@silentmedia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7pvBwvRf9MCmZF9L" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --7pvBwvRf9MCmZF9L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 10, 2021 at 08:36:45PM -0500, Rita wrote: > Yes, I have read the manual and seen this. It pauses the replication > (select pg_is_wal_replay_paused()). But on the primary, when I look at > pg_stat_replication, it still says 'streaming' in the state column. My > question was how do I get it from 'streaming' to anything else? ( > https://www.postgresql.org/docs/11/monitoring-stats.html#PG-STAT-REPLICATION-VIEW) > ? pg_is_wal_replay_paused() pauses WAL *replay* at recovery, but it does not stop the stream of WAL from the primary to its standbys. > I want to trigger an alert when 'streaming' isn't there. Or is there a > better way to do it? If you want to have some automated test to check a given state of the replication, you could use a combination of a SIGSTOP on the WAL receiver of the standby and/or the WAL sender of the primary, with some pg_terminate_backend() calls, just to throw one idea in the bucket. -- Michael --7pvBwvRf9MCmZF9L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmGMgtcACgkQnvQgOdby QH3R5Q/7BjcPlqkN1MBem6C1umnv7wmrNJnpLkaHXAZaMWfs3alymsLKzHsH3QvO wW4BroOYJb/5ibqdpuhYVGU6kVOkt9Sb16kp8nL4LJeeX76brsGvtxe36nu2Uoq4 2dqShDacQYqF9c8jCP5QwlXvJt8lFMT3clqsZr+FZIq+aj2gptoDC/u1/FKqkseQ 0zge1ENOwPY2fg0Z4oL2UEr8f1SbMbn+kNfs0catZd714l/QSK1a9YlFgAv8HhNQ TAAHpOb7NixteAy6bG849nulC4BZVrwBOgs39HdjErtiSjG6M6eu2nVNT6g+EZYJ uzxXDcWSOZHdgl9wPjbQ0FOsrmH9p7W0Yz3nt4iEUbT+kD9f4+mDiKm8TFcWiioz yLchEEeCUIqMQtYFNgUDFYMo4HE8MHOiW1xL79jvGLi2Ad4wE0Lan8VbOjVH9Oh+ SV+TBDW1vHeRyUdQcL5qJtVmnEuA1JTv8knAqQe0/jf82pgkDLOQFElnTYU7bUQI fL0NubTkiH+EuGrZ7ge8GYVcg5C6vNmF9OQmMc0GQPJn3t9jrYqqbMO1SvXNzCy/ ZRN81E5JCStq78PCMp+2TO9jwT0t2mMVHbhU85libdST0V/D4POx6tey/rd1hXBQ E1xjD12N0IGkGBWfiTpFqlSQAHWsci4k1+auo/dCDERAXuLbfEA= =WEw7 -----END PGP SIGNATURE----- --7pvBwvRf9MCmZF9L--