Re: Replication slot is not able to sync up

2025-05-30 Thread Amit Kapila
On Thu, May 29, 2025 at 6:01 PM Robert Haas wrote: > > On Wed, May 28, 2025 at 12:15 AM Zhijie Hou (Fujitsu) > wrote: > > I think the SQL API was mainly intended for testing and debugging purposes > > where controlled sync operations are useful. For production use, the > > slotsync > > worker (w

Re: Replication slot is not able to sync up

2025-05-30 Thread Amit Kapila
On Fri, May 30, 2025 at 4:05 PM Amul Sul wrote: > > Quick question -- due to my limited understanding of this area: why > can't we perform an action similar to pg_logical_slot_get_changes() > implicitly from pg_sync_replication_slots()? Would there be any > implications of doing so? > Yes, there

Re: Replication slot is not able to sync up

2025-05-30 Thread Amul Sul
On Fri, May 30, 2025 at 4:32 PM Amit Kapila wrote: > > On Fri, May 30, 2025 at 4:05 PM Amul Sul wrote: > > > > Quick question -- due to my limited understanding of this area: why > > can't we perform an action similar to pg_logical_slot_get_changes() > > implicitly from pg_sync_replication_slots(

Re: Replication slot is not able to sync up

2025-05-30 Thread Amul Sul
On Fri, May 30, 2025 at 3:38 PM Zhijie Hou (Fujitsu) wrote: > > On Wed, May 28, 2025 at 2:09 AM Masahiko Sawada wrote: > > > > On Fri, May 23, 2025 at 10:07 PM Amit Kapila > > wrote: > > > > > > In the case presented here, the logical slot is expected to keep > > > forwarding, and in the consecut

RE: Replication slot is not able to sync up

2025-05-30 Thread Zhijie Hou (Fujitsu)
On Wed, May 28, 2025 at 2:09 AM Masahiko Sawada wrote: > > On Fri, May 23, 2025 at 10:07 PM Amit Kapila > wrote: > > > > In the case presented here, the logical slot is expected to keep > > forwarding, and in the consecutive sync cycle, the sync should be > > successful. Users using logical decod

Re: Replication slot is not able to sync up

2025-05-29 Thread Robert Haas
On Wed, May 28, 2025 at 12:15 AM Zhijie Hou (Fujitsu) wrote: > I think the SQL API was mainly intended for testing and debugging purposes > where controlled sync operations are useful. For production use, the slotsync > worker (with sync_replication_slots=on) is recommended because it > automatic

Re: Replication slot is not able to sync up

2025-05-29 Thread shveta malik
On Wed, May 28, 2025 at 11:56 AM Masahiko Sawada wrote: > > > I didn't know it was intended for testing and debugging purposes so > clearilying it in the documentation would be a good idea. I have added the suggested docs in v3. thanks Shveta v3-0001-Improve-log-messages-and-docs-for-slotsync.

Re: Replication slot is not able to sync up

2025-05-27 Thread Masahiko Sawada
On Tue, May 27, 2025 at 9:15 PM Zhijie Hou (Fujitsu) wrote: > > On Wed, May 28, 2025 at 2:09 AM Masahiko Sawada wrote: > > > > On Fri, May 23, 2025 at 10:07 PM Amit Kapila > > wrote: > > > > > > In the case presented here, the logical slot is expected to keep > > > forwarding, and in the consecut

RE: Replication slot is not able to sync up

2025-05-27 Thread Zhijie Hou (Fujitsu)
On Wed, May 28, 2025 at 2:09 AM Masahiko Sawada wrote: > > On Fri, May 23, 2025 at 10:07 PM Amit Kapila > wrote: > > > > In the case presented here, the logical slot is expected to keep > > forwarding, and in the consecutive sync cycle, the sync should be > > successful. Users using logical decod

Re: Replication slot is not able to sync up

2025-05-27 Thread Masahiko Sawada
On Fri, May 23, 2025 at 10:07 PM Amit Kapila wrote: > > In the case presented here, the logical slot is expected to keep > forwarding, and in the consecutive sync cycle, the sync should be > successful. Users using logical decoding APIs should also be aware > that if due for some reason, the logic

Re: Replication slot is not able to sync up

2025-05-26 Thread shveta malik
On Mon, May 26, 2025 at 12:02 PM shveta malik wrote: > > Agree that log messages need improvement. Please find the patch > attached for the same. I also intend to update the docs in this area > for users to understand this feature better, and will work on that > soon. > PFA the patch with doc cha

Re: Replication slot is not able to sync up

2025-05-25 Thread shveta malik
On Sat, May 24, 2025 at 10:37 AM Amit Kapila wrote: > If the > > problem is that we're not able to create a slot on the standby at an > > old enough LSN or XID position to permit its use with the > > corresponding slot on the master, it should be reported that way. > > > > That is the case, and w

Re: Replication slot is not able to sync up

2025-05-23 Thread Amit Kapila
On Fri, May 23, 2025 at 11:25 PM Robert Haas wrote: > > On Fri, May 23, 2025 at 12:55 AM Amit Kapila wrote: > > The remote_slot (slot on primary) should be advanced before you invoke > > sync_slot. Can you do pg_logical_slot_get_changes() API before performing > > sync? You can check the xmin o

Re: Replication slot is not able to sync up

2025-05-23 Thread Robert Haas
On Fri, May 23, 2025 at 12:55 AM Amit Kapila wrote: > The remote_slot (slot on primary) should be advanced before you invoke > sync_slot. Can you do pg_logical_slot_get_changes() API before performing > sync? You can check the xmin of the logical slot after get_changes to ensure > that xmin has

Re: Replication slot is not able to sync up

2025-05-22 Thread Amit Kapila
On Fri, May 23, 2025 at 9:57 AM Suraj Kharage < suraj.khar...@enterprisedb.com> wrote: > Hi, > > Noticed below behaviour where replication slot is not able to sync up if > any catalog changes happened after the creation. > Getting below LOG when trying to sync replication slots using > pg_sync_rep