Re: failover logical replication slots

2025-06-12 Thread Fabrice Chapuis
yes of course, maybe for PG 19 Regards, Fabrice On Thu, Jun 12, 2025 at 12:31 PM Amit Kapila wrote: > On Thu, Jun 12, 2025 at 3:53 PM Fabrice Chapuis > wrote: > > > > However, the problem still persists: it is currently not possible to > perform an automatic switchover after creating a new sub

Re: failover logical replication slots

2025-06-12 Thread Amit Kapila
On Thu, Jun 12, 2025 at 2:32 PM Fabrice Chapuis wrote: > > Thanks for the reply Amit, > > I don't really understand the logic of the implementation. If the slot name > matches that of the primary slot and this slot is in failover mode, how could > it be any different on the standby slot? > On t

Re: failover logical replication slots

2025-06-12 Thread Amit Kapila
On Thu, Jun 12, 2025 at 3:53 PM Fabrice Chapuis wrote: > > However, the problem still persists: it is currently not possible to perform > an automatic switchover after creating a new subscription. > > Would it be reasonable to consider adding a GUC to address this issue? > I can propose a patch i

Re: failover logical replication slots

2025-06-12 Thread Fabrice Chapuis
The parameter* sync_replication_slots* could be tested if it is set to true before doing any action on failover slots. Regards, Fabrice On Thu, Jun 12, 2025 at 12:06 PM Amit Kapila wrote: > On Thu, Jun 12, 2025 at 3:07 PM Amit Kapila > wrote: > > > > On Thu, Jun 12, 2025 at 2:32 PM Fabrice Cha

Re: failover logical replication slots

2025-06-12 Thread Fabrice Chapuis
However, the problem still persists: it is currently not possible to perform an automatic switchover after creating a new subscription. Would it be reasonable to consider adding a GUC to address this issue? I can propose a patch in that sense if it seems appropriate. What is your opinion Regards

Re: failover logical replication slots

2025-06-12 Thread Amit Kapila
On Thu, Jun 12, 2025 at 3:07 PM Amit Kapila wrote: > > On Thu, Jun 12, 2025 at 2:32 PM Fabrice Chapuis > wrote: > > > > > After the first failover, the following failovers will work given that the > > sync flag is true on both the primary and standby slots. > > > > After new sandby is attached

Re: failover logical replication slots

2025-06-12 Thread Fabrice Chapuis
Thanks for the reply Amit, I don't really understand the logic of the implementation. If the slot name matches that of the primary slot and this slot is in failover mode, how could it be any different on the standby slot? After the first failover, the following failovers will work given that the s

Re: failover logical replication slots

2025-06-11 Thread Amit Kapila
On Wed, Jun 11, 2025 at 10:17 PM Fabrice Chapuis wrote: > > Thanks for your reply. > The problem I see is that after creating a new subscription, we have: > > 1) if a failover occurs, on the new primary node, the failover and sync flags > are both set to true, so there's no problem. > > 2) when t

Re: failover logical replication slots

2025-06-11 Thread Fabrice Chapuis
Thanks for your reply. The problem I see is that after creating a new subscription, we have: 1) if a failover occurs, on the new primary node, the failover and sync flags are both set to true, so there's no problem. 2) when the old node returns as a secondary in the cluster, the failover flag is

Re: failover logical replication slots

2025-06-10 Thread Dilip Kumar
On Wed, Jun 11, 2025 at 10:18 AM Zhijie Hou (Fujitsu) wrote: > > On Tue, Jun 10, 2025 at 11:46 PM Fabrice Chapuis wrote: > > I'm working with logical replication in a PostgreSQL 17 setup, and I'm > > exploring the new option to make replication slots failover safe in a highly > > available environ

RE: failover logical replication slots

2025-06-10 Thread Zhijie Hou (Fujitsu)
On Tue, Jun 10, 2025 at 11:46 PM Fabrice Chapuis wrote: > I'm working with logical replication in a PostgreSQL 17 setup, and I'm > exploring the new option to make replication slots failover safe in a highly > available environment using physical standby nodes managed by Patroni. > > After a swit