On Tue, 18 Feb 2025 at 19:49, PG Doc comments form <nore...@postgresql.org> wrote: > > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/17/functions-admin.html > Description: > > The documentation for pg_copy_logical_replication_slot doesn't mention that > the failover property for the logical slot is not copied. > > I assumed there was a good reason for this, and I found a comment in the > source code that explains it (although I don't really understand). > It says > * To avoid potential issues with the slot synchronization > where the > * restart_lsn of a replication slot can go backward, we set > the > * failover option to false here. This situation occurs when > a slot > * on the primary server is dropped and immediately replaced > with a > * new slot of the same name, created by copying from another > existing > * slot. However, the slot synchronization will only observe > the > * restart_lsn of the same slot going backward. > > I assumed that by default, all properties from the original slot would be > copied, so this function left me wondering why my logical replication slots > were not being synced to the replica.
Hi, The failover option is set to false by default while copying of the slots as it may cause some issue during slot synchronization as per discussion [1]. I have created a patch to update the documentation for the same. [1]: https://www.postgresql.org/message-id/CAD21AoCoX%2Bjhy_i3v%2BT2s78NG_0HH1oXOUiTOWhDdxVPBtDHKA%40mail.gmail.com Thanks and Regards, Shlok Kyal
v1-0001-Improve-documentation-for-pg_copy_logical_replica.patch
Description: Binary data