Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4HhR-0003O1-Ia for pgsql-general@arkaria.postgresql.org; Thu, 14 Mar 2019 04:10:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h4HhP-0003S2-Ae for pgsql-general@arkaria.postgresql.org; Thu, 14 Mar 2019 04:10:31 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4HhP-0003Rv-1v for pgsql-general@lists.postgresql.org; Thu, 14 Mar 2019 04:10:31 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4HhL-0003SX-2C for pgsql-general@lists.postgresql.org; Thu, 14 Mar 2019 04:10:30 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 0ECF737D0; Thu, 14 Mar 2019 00:10:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 14 Mar 2019 00:10:24 -0400 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=fm1; bh=6rmNei88Jw/pk+KYykKy8HPU503 hNSU79bfzr+DAPwo=; b=QmbvoXvPvBtviLYLXchiWf1tTZQzXZfR5rQfeA1gmdl 21JMLWFnZ8YuhEaC6K+X4YBbVi5qDgV6/kpNI0sUT1jP46ibjXRNMxyR6dZE85Vh 5bTuqyT52bEUbvBv2uAAK1/ga5Co2GT8LfaNXuDj11MJRSVgqLp5iEH2ciyd9/kr rOqn9JZRs6UvaxgOa6JrZFT3bjnim3A1JhY/AbYA3rZDy7P9Y7KDa4COSQGFaFWW psQcf3MX2hjYpjFBlirtT9nCKcpHyMmKwVrqxyfUejv58U16nUIlt2TZjNh+U2zg MS7KTYFuUVC+90mC38A/b2N7Wdrn4ofVfcNlj9BcI9g== 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=fm2; bh=6rmNei 88Jw/pk+KYykKy8HPU503hNSU79bfzr+DAPwo=; b=YwdJZelz8rrge2XnLbG18Y nb0440RpHX3sBBZ/uC678HLQVr6c1OZy/qD4ebUCAwG7CIPeNYSHbiOMaMxbCBD/ XpM7LjSUsNqMX4MPPI+mJK+0p9wbjBVh9l1PblCGJR8NkjbM/j1NuAMfforMkUKX yooR9crIXy3/81s3Y8vTXriOemspehEE3BaKJG5dFUv/nj2gy2BRG9yvmHk0LanG lYh8YNsCSEssmwNm7BmcOLP67SZGPyTx+hnvJvWVMkoeB7cUEUqoySTXumfiwgi0 b3C2A4qpKrU3D3odkEs4anYJXHIvTnxkQFyj5V1Q9pIaYZOnD+1jj2mcuMyajtYA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrhedugdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfk phepiedurddvudehrddufeejrdduiedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmih gthhgrvghlsehprghquhhivghrrdighiiinecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 11D28E415C; Thu, 14 Mar 2019 00:10:21 -0400 (EDT) Date: Thu, 14 Mar 2019 13:10:19 +0900 From: Michael Paquier To: Michael Cassaniti Cc: pgsql-general@lists.postgresql.org Subject: Re: Notification or action when WAL archives fully restored and streaming replication started Message-ID: <20190314041019.GF3493@paquier.xyz> References: <9b97926f-ba7f-2fb1-bb4f-74ed33e49c2b@cassaniti.id.au> <8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PyMzGVE0NRonI6bs" Content-Disposition: inline In-Reply-To: <8aee6f5f-6ed8-ed96-f1f4-ec8a38305eed@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --PyMzGVE0NRonI6bs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 14, 2019 at 02:59:38PM +1100, Michael Cassaniti wrote: > I've got master/slave replication setup between a few hosts. At any > point a slave could become a master. I've got appropriate locking in > place using an external system so that only one master can exist at a > time. I'm having trouble determining when my slaves are in sync with the > current master so that they can be a candidate for promotion. I want > some form of indicator _without reading a log_ when streaming > replication has started. pg_stat_replication on the primary, no? Here is its documentation: https://www.postgresql.org/docs/11/monitoring-stats.html#MONITORING-STATS-VIEWS -- Michael --PyMzGVE0NRonI6bs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlyJ1CsACgkQnvQgOdby QH2Ptg/8CkwVotWS6IPPSCix7jsHfMPtmRR3ne7Ai2V6VO/5uGbOA+HBU3J1ls0p O7ZCTv7WPzFhNTgRNL/1VKyTLY0HRtYevMlK4Y1Llk2CAFzZaJqWzityD11ltqA8 d6uNVOpApmeRwzAAkBYWlrj9/QZs+A/h3MORLc5EQrj29xl9+A32Vsiigza7FpUH 1gNaoNH7OU8RcFyB7eGbtmBIpkbZWZWdrFKh7YTNNsXezLDcuJSxoOT3a3KsJpPm PiySW3hTvQCLwoxW2tFP0yhu1/0Xh5wfK8Wejzv1ZcvM3pHyFBiBtYHd9HCAEQBf xKpH9MuHnnYciAVBRHH2zgnO9lvAgwoaAkEMu6kTS9r7k9d5V0m3U362iz/ICCND E0VZMq5dmPVAkPlsZlo8Ztfx0xpMvD+CPCYzJgmrVHqKXsJx1ob+h+dghmfUIgAz kPas5VKAw0fFjpZ6LRLwwAv7isKrRJcpvHJXJO/lCYuXNrsMNs581pahudFXUZeV 8aJUh3zCjGx9kfXZAdNI7i4brEYBqvsviBEf3MfUBJ27k85cuKl8jdU9O8oG6Fba wmKmDUtIRSxR0p5Xe/A23Vj+XQGQBHj8OlSlB7+KDgstvvtlnJmiZsiKBCslv43c zaLWpH+W3VQft8SCdIxiLzwfmp6AA8xG406EEC3h0zGqG+UMpTE= =LMSZ -----END PGP SIGNATURE----- --PyMzGVE0NRonI6bs--