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 1tMscD-0078Un-Kx for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:41:14 +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 1tMscB-00FW26-5m for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:41:12 +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 1tMscA-00FW1x-ML for pgsql-general@lists.postgresql.org; Sun, 15 Dec 2024 17:41:12 +0000 Received: from mail-norwayeastazon11023077.outbound.protection.outlook.com ([40.107.159.77] helo=OSPPR02CU001.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tMsc9-0030Qf-5k for pgsql-general@lists.postgresql.org; Sun, 15 Dec 2024 17:41:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B0MAT0X6ZQJ1sRMz+a3pC+/MKlsw6xaEocs/EDISC8kNTMv+ithSCJa+rqYrUtcNKYcMf1CouYcJ4AlI8hP0mO9p0R3FeaA4o4gh4z336KepQ1bm0KwzJB8NISZ1rtejzhRoRYnDLCNj+XWIwKAzDhSbZ75x/dzCiBIXlmmMIDGVnuKru6TScR71As1pLGZcd9vdNYfPi6ZB0aKCFGe86+MiJ14ktxmO+Py0n8vHTR0kjTW8b1qwQR9XwjFt2PS7h4+MbWcLo67d4+wpPry5k0aQCMhTNVffrJaybwEokdMGX0PNSbriMu8S7ZSdSCn+P+KJGIf8A2jsaNlxy30BvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PJ0El4Fwna4q4DKe4auPEPtOTtFwRx9JF1S8Aw/f1Bg=; b=nNA/ReP7KVg5DyMeDgnEbzxqdiGSvYKuiU1qAmEjP4UGLWqzcJ9+I81aWt0pQbNdW6Mhj+sCVpku/lIM+B01A1XcAwzAkLZKztUQ2kONoSrDiSarxjwdnDW5UHS5xi6+9SXc+jfWqyO4efu1IG8F9FEm/12SDrgreFQtcQMqg0V4mxbJuamSYHpJbG0a1VSjzqQ+etEm0M3KP0+SIeAChW4shlahW053VtLpU7mlcCRftwtcl0/p3DlVVaQ+LPE3Wsgx27hGOZE64GQn6clf52HoXVGvjELBeLpnjAxikyJaFXK5AHYqrYUz3j/hxeBwsmSy2cM4az0g0EjKW/y1Iw== 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=gilat.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PJ0El4Fwna4q4DKe4auPEPtOTtFwRx9JF1S8Aw/f1Bg=; b=W1lfvOfk8FjPBjxObtOefa/E6/onkMrvWzjEi487bNYjPA3bNlzqJl7099iBRFPfg/QuWQVrfPEXtlISxgzr/+FQjs+gwx90/chTTkjWBpei/CHNRcgVGsYYjzONlkS01uhIP5EztnOxJu21858qLHp/J2t7JZEG/dkWzHP2BbU= Received: from DB9PR07MB7180.eurprd07.prod.outlook.com (2603:10a6:10:215::5) by DB9PR07MB9342.eurprd07.prod.outlook.com (2603:10a6:10:454::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.20; Sun, 15 Dec 2024 17:41:05 +0000 Received: from DB9PR07MB7180.eurprd07.prod.outlook.com ([fe80::270e:36ee:e6c1:1c92]) by DB9PR07MB7180.eurprd07.prod.outlook.com ([fe80::270e:36ee:e6c1:1c92%6]) with mapi id 15.20.8251.015; Sun, 15 Dec 2024 17:41:05 +0000 From: Avi Weinberg To: pgsql-generallists.postgresql.org Subject: Continue Logical Replication After Master Became Slave and then Became Master Again Thread-Topic: Continue Logical Replication After Master Became Slave and then Became Master Again Thread-Index: AdtPGINR7zQ7kwdZQqqS2jb9IhMiXw== Date: Sun, 15 Dec 2024 17:41:05 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=gilat.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB9PR07MB7180:EE_|DB9PR07MB9342:EE_ x-ms-office365-filtering-correlation-id: 26b89a7a-1a5f-46d0-820b-08dd1d2fa6df x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|8096899003|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?cFXWCNhL8gBCFZHdDXprQHbsVK8Hzwbp590y3ay9hWGYrEtPPvWNnfK8A1oa?= =?us-ascii?Q?8wPsEV+ZSxT0A8SWHwUzjN5mrQdPR3zTjFhWWg4JDZDeC1b2D3pj/xy582/F?= =?us-ascii?Q?UD61qHYOZIvhoTktde0EhA59YGe5STvP0nDy/9T5iIVcTT6EOtmPg2VmHOcM?= =?us-ascii?Q?XCYuQ7FBUp8BU55tuV5WEraDoeZvr5PSR4PwlLbgPytYttjQ9Z1D+8EklAFx?= =?us-ascii?Q?In441jh4jFYJk3RmYzEyjiPl62Glkwbu7uP8ufuTs8JPUPne+bj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QdRa9jP9+K9fCJfHdCx5Dc3nvomMQwDx8rB0/5/?= =?us-ascii?Q?B/t9c6jEKc9OVkfzODK6sG9MDSwSjr81XeSIA9Khet7FB2secZjCwn3I58Ix?= =?us-ascii?Q?W/ol+99HZYiXEwzflWxHMxlOQ7/3+fyDj/ja02WrH/Wl666PEzzCyEtiJUoz?= =?us-ascii?Q?6YIbZIbUdTTOPgxqRCq92eDNQL0UFYhMadiDOYr5B2y1IYdabCAYALsPC4b1?= =?us-ascii?Q?55Qk+U1FmhAZgCtHYS66Xl97hZ/OWK6XipLTxCKco2Ov0/hilI8a4rYywTE6?= =?us-ascii?Q?OORSEu5/pvLKe2WCVkEGscT6eY3KR0dy?= 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:(13230040)(1800799024)(376014)(366016)(8096899003)(38070700018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rs9s4jLxuhlwzQ1oourolQfXNLNUfb4RpXU5000EYM2nGUPX2EJr8xS7jf88?= =?us-ascii?Q?1M6lQSoYsXTvTL6Nn9257fr2uy1aycPPQq4FDJTsEPgT8SN9FkmZG2h5fHVv?= =?us-ascii?Q?0ZuB8vjYqbTMKTC4AhDreBnfSj7l+HD8AB1ie5wwb5N3DwoDEqaqxCdaIKrS?= =?us-ascii?Q?2WVzwsJoio5V+A3uSpxEJI4ZzldMsicXlQk2QDOpKGF3xnpdudrfu9BjG56o?= =?us-ascii?Q?Ih0R6rtHfoFCIwOthm46dFFVmoGm5pYea2p/QzyoTZF+BqTWIi/2yWcP1/sE?= =?us-ascii?Q?fK/bFgV1+HEaHxK9GXOIS5vSQM+vkeJLVxJ4ePOoM7h4qm+mrXLf5ox7PtYe?= =?us-ascii?Q?mAEFyHSJA7JV78uTXATTy28t9YJ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CBspPneZ74tESCRu2+Be6O9++g4yGQELLqcRSHZ3l5xu8GuCPsnO?= =?us-ascii?Q?lJrHGLl7du8oW5dzKCPALPl9l7TCWvCeyy+BgOb5oAFcNlt3jzqY0UV//0fo?= =?us-ascii?Q?+HMzJMz/fVmyhJmJhtPhFE6Ldw5/kuUtgKSzrexhpsU47FDM1/WdjqRvtFGU?= =?us-ascii?Q?0/XP82RWEHKIo22aEI9RXsh4GK/FqlbRovW2hGWzmPMbzuMkeW//loJeSnIU?= =?us-ascii?Q?YsMR121uEC1M0ddfR46beJJq13+VUyRdn42ToCMO4Q6YutQjMiSP1Zx3As7f?= =?us-ascii?Q?/EcfLjF59XD4u8wI7C8=3D?= Content-Type: multipart/alternative; boundary="_000_DB9PR07MB71806094127BF5936A6DB07ACB3A2DB9PR07MB7180eurp_" 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: 26b89a7a-1a5f-46d0-820b-08dd1d2fa6df X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2024 17:41:05.6665 (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: ou6iekI5o0re2xdP4NEZdqHgYkkh0vmKxiiCLQjZOqPF30GA+phCZZ9JCwtQa/bZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9342 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_DB9PR07MB71806094127BF5936A6DB07ACB3A2DB9PR07MB7180eurp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi All, Postgres 15.2 We have Patroni cluster with one master and two replicas. The master is pu= blisher (logical replication) to some subscriptions running on other cluste= rs. When we have a failover, the master becomes replica and one of the rep= licas assume the role of master. In such a case, we need to rebuild the su= bscriptions to point to the new master. However, to avoid that, can we jus= t do fallback and move back to the old master assuming the following option= s - what if: 1. No data was written to the database from the time of the failover unt= il the failback 2. No data was written to the replicated tables (but other tables were u= pdated) from the time of the failover until the failback 3. The replicated tables were updated from the time of the failover unti= l the failback 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_DB9PR07MB71806094127BF5936A6DB07ACB3A2DB9PR07MB7180eurp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi All,

 

Postgres 15.2

 

We have Patroni cluster with one master and two replicas.  The = master is publisher (logical replication) to some subscriptions running on = other clusters.  When we have a failover, the master becomes replica and one of the replicas assume the role of mast= er.  In such a case, we need to rebuild the subscriptions to point to = the new master.  However, to avoid that, can we just do fallback and m= ove back to the old master assuming the following options – what if:

  1. No data was written to the database from the time of the failover until the= failback
  2. No data was written to the replicated tables (but other tables were updated= ) from the time of the failover until the failback
  3. The replicated tables were updated from the time of the failover until the = failback

 

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_DB9PR07MB71806094127BF5936A6DB07ACB3A2DB9PR07MB7180eurp_--