Re: failover logical replication slots - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: failover logical replication slots
Date
Msg-id CAA4eK1Li9RO0nWbpV+JnjfqVLwdh_44ZQo=JWz7Z8DZ40_uiUA@mail.gmail.com
Whole thread Raw
In response to Re: failover logical replication slots  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Thu, Jun 12, 2025 at 2:32 PM Fabrice Chapuis <fabrice636861@gmail.com> 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
slotis in failover mode, how could it be any different on the standby slot? 
>

On the standby's we do allow creating logical slots (For example, one
can use pg_create_logical_replication_slot()). So, the same name slot
can be created on standby by the user before we start sync. As of now,
we don't allow setting the failover option for slots on standby's but
in future, it could be supported to allow syncing slots from standbys
(something like cascaded replication).

> After the first failover, the following failovers will work given that the sync flag is true on both the primary and
standbyslots. 
>
> After new sandby is attached to the primary, can we imagine that when the sync worker process is started we check if
afailover slot exists on the standby, if so we drop it before recreating  a new one for syncing? 
>

This has the risk of dropping an unwarranted slot.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: [PATCH] Proposal: Improvements to PDF stylesheet and table column widths
Next
From: Fabrice Chapuis
Date:
Subject: Re: failover logical replication slots