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 1lt2Ks-0004dm-3C for pgsql-admin@arkaria.postgresql.org; Tue, 15 Jun 2021 06:14:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lt2Kr-00077S-2d for pgsql-admin@arkaria.postgresql.org; Tue, 15 Jun 2021 06:14:05 +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 1lt2Kq-00077E-FJ for pgsql-admin@lists.postgresql.org; Tue, 15 Jun 2021 06:14:04 +0000 Received: from mail-eopbgr10064.outbound.protection.outlook.com ([40.107.1.64] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lt2Kk-00008Q-3l for pgsql-admin@lists.postgresql.org; Tue, 15 Jun 2021 06:14:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TjTjO/T7Eet4BuT82qO9SY/PKSSFvwpNyHTAQi5tv1H7Lb0jrYGla3jz70OUsYQoexDOD7khCNQcJLq2R68yjBWvCZn8ogDc/40YwmfSnMiblarGff2N8q9M7hGi0nsIvsGbPuK2ZTBPUXi/2wjgyN4TDH4QMvgzo8sxZzon4lk0Tw2Lx2x+kTTrw4ixiHHqRh8JX7OdI9GKaOLuTTbe6oyYzliOBpJum78cArql65gwoUoPjzg25RmZ0YbwmqZtaCaGK/c/plYewpDJ7pyHUOrfnRGMDAdv88/qEhcvL7a/X1hepZC7MrGd9/EP7YZ92VE10B88cCI6fsSG+EouJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UhX+TyNpgTqte+GkuwY+0UeAFCVDPkvlAzVHnHy+rko=; b=fNgHWxaRraUKQWHBgJZV2tsppWcbcb0oqBfUPYVKNZj06iwKJgWksPRToTi1HNZVWIzwdbcdQ+jwmENWkJf1ZmENXoJAezavUx8Q38RQpOM6eier+0nYM9EbNgBM8ddjw1vKIV+IoI9SSkQKVwNu3a8ryGmynd5bQZlL1b/9K9xrnI6sjfP2CYX/Yw5XJ1cb/AOxp4/iNC//CzOTWOKsQtmMIB+gmvxzkGXZSBhXSF70ZE0o4Do1rPYWWDB60nuHVtztcLd10YjyShaCtmBz/Vk5okQmJNvzwGLRpFNQ5mrysS1xe9jsoiUBuswNqTVKdy2UqcWZVAWVm0GObgvR0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=gilat.com; dmarc=pass action=none header.from=gilat.com; dkim=pass header.d=gilat.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gilatsatnet.onmicrosoft.com; s=selector1-gilatsatnet-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UhX+TyNpgTqte+GkuwY+0UeAFCVDPkvlAzVHnHy+rko=; b=QjzYL1OHsNUExM+m0H3zDEhkf/OtNMUYg5mOl+w3pUDPn+X3dpnu9cf3mOYmjcsmhyyQ/47JaNRCPgsm2Vj6c5fzu6bvQPLBWWHQ9L/lQobGSJPTPFeSr2IqvyHl3qnAmhVSeHF1yCrzchfx0B0jGziu7vfWJ5vyKNbjwYB6K8M= Received: from DB9PR07MB7180.eurprd07.prod.outlook.com (2603:10a6:10:215::5) by DB6PR0701MB2485.eurprd07.prod.outlook.com (2603:10a6:4:65::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.10; Tue, 15 Jun 2021 06:13:52 +0000 Received: from DB9PR07MB7180.eurprd07.prod.outlook.com ([fe80::f525:88c3:2c63:8bc3]) by DB9PR07MB7180.eurprd07.prod.outlook.com ([fe80::f525:88c3:2c63:8bc3%4]) with mapi id 15.20.4242.014; Tue, 15 Jun 2021 06:13:52 +0000 From: Avi Weinberg To: "pgsql-admin@lists.postgresql.org" Subject: Be Notify Upon Streaming Replication Failover Thread-Topic: Be Notify Upon Streaming Replication Failover Thread-Index: AddhrZvxPB/kMsOMSqOPtZIp7vvCJg== Date: Tue, 15 Jun 2021 06:13:51 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.postgresql.org; dkim=none (message not signed) header.d=none;lists.postgresql.org; dmarc=none action=none header.from=gilat.com; x-originating-ip: [91.228.163.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 959141c7-32c6-437a-7624-08d92fc4bf65 x-ms-traffictypediagnostic: DB6PR0701MB2485: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SK8akNVBSoQV5iFxUDP8hOnytfwqGAVeLAwcBPrbk6EA5NoN0T9Okz5TopT4RWhVjh9xaOGlCpvx5Zz3LyAnPqu8GC8KA2c74tmCN/gy148iUXZf+d4OboQSqldMGTEWe3W+Gs44zdi34Ts1RwgYqtU8T2ulCvBRvqktfk6zmhCUg/QefgtJFrq9NdltrgXKgXUbmR0Pj7GP/1kVdgvgINk56PQUg5UX2lISnBxB5zdZn+AsgnxojWw93wXUjifosRKbonsi82vQ8oI4LaQAZi7lQy2SYA0hIKNQBsvj0lGHOkRqJRFtP5LIFC2NdWVHrlP2GoEQdVCGc4+ucDbNmGckZx09WSGow+BcMgzSP6nSpKdGIJ5JGSd4OOj2/3/OaCnU6CjFgc0Pa3ESp2Z+ruYtIbSwl9ihMJOTWSh71AtQrMnrxsK1RN3jBnQM6lSnMxJ5JdmpRULOSMtWmHyGQONHvDpNN3tSGQulaT5emRyzkmLjDFyIOZarg3vDMVbZbsjPpZr8Y68CD3sEeWXDpkXuRRyNKrOhkc9kh9LVaq/JNteF2/Jex0uYX2HJCJT4pUEoGAIcjm+is4T9KPWTUpE0vZAl6HmIhEVEIw85YxOMGcnygn+P08zH413O2NRofqJS/4IduEHazuGdcdcJrEHeUqTWwSyOiEky/x9j/ck= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR07MB7180.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(6506007)(52536014)(71200400001)(498600001)(2906002)(38100700002)(8676002)(33656002)(8936002)(122000001)(6916009)(76116006)(86362001)(26005)(186003)(66946007)(9686003)(7696005)(4744005)(64756008)(66556008)(66476007)(66446008)(83380400001)(5660300002)(55016002)(138483002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iEz4OCMEPvtQOliHxVnAKPoDfY2B0Jav8Qwgf+FUjotOJVBIXAlbiJc0bLUF?= =?us-ascii?Q?gD8UxHR+uRfzIau9nRCrdilj3wVG6aBEKDJVVIynBojhb0z7EQ5vf/4CBR1T?= =?us-ascii?Q?jcTKZDSaa8jQ4z4X9W8wAw1Uiimshloey5Kivo+gndH3twptOkSPFpy9EQ/P?= =?us-ascii?Q?3JKl4RaVoh06cPxo3ft6gcLRqN9eVSH7E1ahrH4AGYoLcm8Ghu+eosPkmdLD?= =?us-ascii?Q?W9LoipcH9PHShPuXjBkpM05+uPtRhUgTrhu8XXAgwYYlucolGniHiAL6CY4c?= =?us-ascii?Q?4XSALs16wsUxWjxOElWS9o0vE6CBOb81NcGld7k1cs87sq2/OQ1VFWaaYuXu?= =?us-ascii?Q?+EVnlAq3VBBJmC/7YbJRLd0if4wC/sG9rUlASHHe8N9BCflkDmCZXmOJDYBj?= =?us-ascii?Q?SwPHSvFEVHENOVVo49BpzILPqR+307677nGWT1/qQLDXiorkMEzUUGjVEJJ3?= =?us-ascii?Q?0+V1QhUTwlIfvlgKs0ZbTqrflca4+igporTGnMZqwLGPVV/EOt78iu8FX8dA?= =?us-ascii?Q?W8e8dS98lToC8YGDTSKelBMtivDI7U8/jXEAQos+1Hu5uZNeh/+Hj0TAfNhY?= =?us-ascii?Q?XVz1x6rYtju5pUfH1hC4l8psbiAPBqKTpP7ROYDTpYy39Xse/MEfbDXRASwf?= =?us-ascii?Q?4WtSl5vVTRyxpSRnOOzTPAIL4v1x4X2lebosE+S8B+PxCoGA/N9nulre0Afh?= =?us-ascii?Q?lyYxKjhi3JTdtwgdaAKpxofZZwolOIuRP29H3uAG02CAiOElSOvzpp2ssvSO?= =?us-ascii?Q?VGpZ+N2vmmcPqq+c9ez4EjurSetgr0NvC4g93LSfzD3qCqGHRu6FWvCOHrqG?= =?us-ascii?Q?XebpQEZorgLTzTugIAdera6LAfcb7oMRVT5zlfmhavkfVp1NiW2fbAjt73iJ?= =?us-ascii?Q?ouupUmNv6+/zHEtx2s4XozlxHp16YJwC171y4mNRlPXkdMrcEqJiduL8aPf1?= =?us-ascii?Q?4rNwr30wsVfnNd6hCT5+hCI8mW4wLlAnNwVNgnoUIYb9omeNpPQX5l+9SYEV?= =?us-ascii?Q?T2FX5KSn5uwq9c70Gwqbm3Za8f9XP1GYBJGSxv+6TJQCNAaZRyv2Wb+mO3Fr?= =?us-ascii?Q?jLz/2QblEXRzfPNCcitblwwdfZvAdRyFytX362hQIGp/GG8vqqG+sYO/R7TQ?= =?us-ascii?Q?3qdJFDORY2cpXoW7ao1FcyAnhGfvFvtuP14hgzz5rMKlP1E35Z22RRVvwrXP?= =?us-ascii?Q?PK/2PiKhnybcHoyKjtCVLXimhibuAwdRFkqlshukJE+YE6VX9WO8bR3/Qzui?= =?us-ascii?Q?bkfT4yrqC4Wb06t3y29EihijW07gvBNoN6GNs7xTtO65R6YzyAahkpUd3g+a?= =?us-ascii?Q?g7rq1mefRDmim9YpL7JjHGZn?= x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_DB9PR07MB71807CC04949A63DF7FCD304CB309DB9PR07MB7180eurp_" MIME-Version: 1.0 X-OriginatorOrg: gilat.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB9PR07MB7180.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 959141c7-32c6-437a-7624-08d92fc4bf65 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jun 2021 06:13:51.9484 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7300b1a3-573a-4010-92a6-1c65cd85e927 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8vKEQSZNgeEfL4Wb6YE7qBeIOUwZKJhP7nhyvM5aAuSHJaDtljMI3eOykovRfDIn X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0701MB2485 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_DB9PR07MB71807CC04949A63DF7FCD304CB309DB9PR07MB7180eurp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I need to take actions when Postgres streaming replication failover occurre= d. Is there a way to be notified when Postgres slave becomes master? If n= o such notification possible, what is the best way to actively monitor whic= h server is master. My Postgres is running inside Kubernetes and the HA i= s 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 privileg= ed. If you are not the intended recipient, please inform the sender immedia= tely and delete this email: you should not copy or use this e-mail for any = purpose nor disclose its contents to any person. --_000_DB9PR07MB71807CC04949A63DF7FCD304CB309DB9PR07MB7180eurp_ Content-Type: text/html; 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 m= aster?  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 Patron= i.

 

Thanks!

 

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