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 1lsZa8-0004EH-QM for pgsql-general@arkaria.postgresql.org; Sun, 13 Jun 2021 23:31:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lsZa6-0001Ni-Bf for pgsql-general@arkaria.postgresql.org; Sun, 13 Jun 2021 23:31:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsZa4-0001J5-NT for pgsql-general@lists.postgresql.org; Sun, 13 Jun 2021 23:31:53 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsZZv-0002i1-AT for pgsql-general@lists.postgresql.org; Sun, 13 Jun 2021 23:31:50 +0000 Received: from DESKTOPABQPBLV (M106072034064.v4.enabler.ne.jp [106.72.34.64]) (authenticated) by conuserg-09.nifty.com with ESMTP id 15DNVPJc011128 for ; Mon, 14 Jun 2021 08:31:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 15DNVPJc011128 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1623627085; bh=NsJJ4B96B8xqzmJ5n5Bv+3pE8MGp2EvBaZvv4ODXwKs=; h=From:To:Subject:Date:List-Help:List-Subscribe:List-Unsubscribe: From; b=abTiHbSxiHCaLfRrEIiGGLeWuyaJRwEeefLCsXb7zwqviDVfufSyfCnfXSYSWq8Hv MPaIMrBQzl0yI6NPIZ7en14Mpywtc5+PSrl+PcPd6jn7iZJywI/3gvaZYtEoGMjMgG NkLHLBTAQNGlhHam2kBHZ3QVe6+eaZPUMlkyZW4eZtFj4G4+aoSGg1WTKoVbkiMMnO MzB8bh19didmmyKduOB/ZK530ex9tjZJct6wigTgRkOQqnWkFSt5IcQbBMkssNCLFN z652klAQVZvp75IBbO0ltwb8+xMJ99+87yiMJGe9N7WH4b6frllQtvsHtJ7CGa0Hcp CaggICuRygcMQ== X-Nifty-SrcIP: [106.72.34.64] From: "Avi Weinberg" Sender: To: Subject: Notify When Streaming Replication Failover Occurred (slave promoted to master). Date: Mon, 14 Jun 2021 08:31:23 +0900 Message-ID: <000001d760ac$38ea9ca0$aabfd5e0$@gilat.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01D760F7.A8D726A0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKExo0S8vo//YcddlvF103OM+4iTQ== Content-Language: en-us List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_0001_01D760F7.A8D726A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I need to take actions when Postgres streaming replication failover occurred. Is there a way to be notified when Postgres slave becomes master? If no such notification possible, what is the best way to actively monitor which server is master. My Postgres is running inside Kubernetes and the HA is managed by Patroni. Thanks! IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person. ------=_NextPart_000_0001_01D760F7.A8D726A0 Content-Type: text/html; boundary="_000_DB9PR07MB7180CCBBE7BA7C900B583596CB329DB9PR07MB7180eurp_"; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I need to = take actions when Postgres streaming replication failover = occurred.  Is there a way to be notified when Postgres slave = becomes master?  If no such notification possible, what is the best way to actively monitor which server is master.  = My Postgres  is running inside Kubernetes and the HA is managed by = Patroni.

 

Thanks!

IMPORTANT - This email and any attachments is intended for the above = named addressee(s), and may contain information which is confidential or = privileged. If you are not the intended recipient, please inform the = sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its = contents to any person. ------=_NextPart_000_0001_01D760F7.A8D726A0--