Re: Replication slot is not able to sync up

2025-06-19 Thread Amit Kapila
On Wed, Jun 18, 2025 at 10:56 AM Amit Kapila wrote: > > On Wed, Jun 18, 2025 at 8:52 AM shveta malik wrote: > > > > On Tue, Jun 17, 2025 at 12:01 PM Amit Kapila > > wrote: > > > > > > This whole paragraph sounds like a duplicate of its previous section, > > > and the line alignment in the first

Re: Replication slot is not able to sync up

2025-06-18 Thread Amit Kapila
On Wed, Jun 18, 2025 at 8:52 AM shveta malik wrote: > > On Tue, Jun 17, 2025 at 12:01 PM Amit Kapila wrote: > > > > This whole paragraph sounds like a duplicate of its previous section, > > and the line alignment in the first paragraph has some issues. > > > > Sorry for the wrong upload, duplicac

Re: Replication slot is not able to sync up

2025-06-17 Thread shveta malik
On Tue, Jun 17, 2025 at 12:01 PM Amit Kapila wrote: > > This whole paragraph sounds like a duplicate of its previous section, > and the line alignment in the first paragraph has some issues. > Sorry for the wrong upload, duplicacy was the merge issue. Removed the duplicate paragraph and corrected

Re: Replication slot is not able to sync up

2025-06-16 Thread Amit Kapila
On Mon, Jun 16, 2025 at 9:27 AM shveta malik wrote: > > Thanks Peter and Amit for feedback. I have updated the patch. > + When slot-synchronization setup is done as recommended, and + slot-synchronization is performed the very first time either automatically + or by + pg_sync_re

Re: Replication slot is not able to sync up

2025-06-15 Thread shveta malik
On Sat, Jun 14, 2025 at 11:08 AM Amit Kapila wrote: > > I feel WARNING and CAUTION markups could be a little strong for the > > concerned case. Such markups are generally used when there is a > > side-effect involved with the usage. But in our case, there is no such > > side-effect with the API.

RE: Replication slot is not able to sync up

2025-06-15 Thread Zhijie Hou (Fujitsu)
On Sat, Jun 14, 2025 at 11:37 PM Dilip Kumar wrote: > > 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 h

Re: Replication slot is not able to sync up

2025-06-14 Thread Dilip Kumar
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-06-13 Thread Amit Kapila
On Thu, Jun 12, 2025 at 10:44 AM shveta malik wrote: > > On Thu, Jun 12, 2025 at 4:13 AM Peter Smith wrote: > > > > Phrases like "... it is recommended..." and "... intended for testing > > and debugging .. " and "... should be used with caution." and "... it > > is advisable to..." seem like ind

Re: Replication slot is not able to sync up

2025-06-11 Thread shveta malik
On Thu, Jun 12, 2025 at 4:13 AM Peter Smith wrote: > > Phrases like "... it is recommended..." and "... intended for testing > and debugging .. " and "... should be used with caution." and "... it > is advisable to..." seem like indicators that parts of the above > description should be using SGML

Re: Replication slot is not able to sync up

2025-06-11 Thread Peter Smith
On Wed, Jun 11, 2025 at 8:53 PM Amit Kapila wrote: > > On Wed, Jun 11, 2025 at 7:19 AM shveta malik wrote: > > > > On Tue, Jun 10, 2025 at 3:20 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > > > > Thanks for updating the patch. > > > > > > I have few suggestions for the document from a user's pe

Re: Replication slot is not able to sync up

2025-06-11 Thread Amit Kapila
On Wed, Jun 11, 2025 at 7:19 AM shveta malik wrote: > > On Tue, Jun 10, 2025 at 3:20 PM Zhijie Hou (Fujitsu) > wrote: > > > > > > Thanks for updating the patch. > > > > I have few suggestions for the document from a user's perspective. > > > > Thanks Hou-San, I agree with your suggestions. Addres

Re: Replication slot is not able to sync up

2025-06-10 Thread shveta malik
On Tue, Jun 10, 2025 at 3:20 PM Zhijie Hou (Fujitsu) wrote: > > > Thanks for updating the patch. > > I have few suggestions for the document from a user's perspective. > Thanks Hou-San, I agree with your suggestions. Addressed in v4. Also addressed Amit's suggestion at [1] to improve errdetail.

RE: Replication slot is not able to sync up

2025-06-10 Thread Zhijie Hou (Fujitsu)
On Thu, May 29, 2025 at 11:09 AM shveta malik wrote: > > 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 i

Re: Replication slot is not able to sync up

2025-06-10 Thread Amit Kapila
On Thu, May 29, 2025 at 8:39 AM shveta malik wrote: > > 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 v

Re: Replication slot is not able to sync up

2025-06-03 Thread Robert Haas
On Fri, May 30, 2025 at 6:08 AM Zhijie Hou (Fujitsu) 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 s

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