On Fri, May 30, 2025 at 6:08 AM Zhijie Hou (Fujitsu) <houzj.f...@fujitsu.com> wrote: > To improve this workload scenario, we can modify pg_sync_replication_slots() > to > wait for the primary slot to advance to a suitable position before completing > synchronization and removing the temporary slot. This would allow the sync to > complete as soon as the primary slot advances, whether through > pg_logical_xx_get_changes() or other ways.
My understanding of this area is limited, but this sounds potentially promising to me. The current approach seems very timing-dependent. Depending on the state of the primary vs. the state of the standby, a call to pg_sync_replication_slots() may either create a slot or fail to do so. A call at a slightly earlier or later time might have had a different result. IIUC, this proposal would make different results due to minor timing variations less probable. -- Robert Haas EDB: http://www.enterprisedb.com