Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-23 Thread shveta malik
On Mon, Sep 22, 2025 at 4:21 PM Ajin Cherian wrote: > > > Created a patch v13 with these changes. > Please find a few comments: 1) + /* update the failure structure so that it can be freed on error */ + fparams.slot_names = slot_names; + Since slot_names is assigned only once, we can make the a

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-22 Thread shveta malik
On Tue, Sep 23, 2025 at 10:29 AM shveta malik wrote: > > On Mon, Sep 22, 2025 at 4:21 PM Ajin Cherian wrote: > > > > > > Created a patch v13 with these changes. > > > > Please find a few comments: > > 1) > + /* update the failure structure so that it can be freed on error */ > + fparams.slot_name

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-22 Thread Ajin Cherian
On Tue, Sep 16, 2025 at 4:23 PM shveta malik wrote: > > On Mon, Sep 15, 2025 at 6:17 PM Ajin Cherian wrote: > > > Thank You for the patch. Please find a few comments: > > 1) > + bool slot_persistence_pending = false; > > We can move this declaration outside of the loop. And I think we don't > nee

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-20 Thread Ajin Cherian
On Thu, Sep 4, 2025 at 4:35 PM shveta malik wrote: > > On Wed, Sep 3, 2025 at 3:19 PM Ajin Cherian wrote: > > Thanks for the patch. Please find a few comments: > > 1) > /* Clean up slot_names if allocated in TopMemoryContext */ > if (slot_names) > { > oldcontext = MemoryContextSwitchTo(TopMemoryC

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-17 Thread shveta malik
On Tue, Sep 16, 2025 at 5:12 PM Ashutosh Sharma wrote: > > > On Tue, Sep 16, 2025 at 11:53 AM shveta malik wrote: > > > > On Mon, Sep 15, 2025 at 6:17 PM Ajin Cherian wrote: > > > > > > On Wed, Sep 10, 2025 at 2:45 PM shveta malik > > > wrote: > > > > > > > > On Tue, Sep 9, 2025 at 5:37 PM Aji

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-16 Thread Ashutosh Sharma
On Tue, Sep 16, 2025 at 11:53 AM shveta malik wrote: > > On Mon, Sep 15, 2025 at 6:17 PM Ajin Cherian wrote: > > > > On Wed, Sep 10, 2025 at 2:45 PM shveta malik wrote: > > > > > > On Tue, Sep 9, 2025 at 5:37 PM Ajin Cherian wrote: > > > > > > > > Attached v11 patch addressing the above comment

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-15 Thread shveta malik
On Mon, Sep 15, 2025 at 6:17 PM Ajin Cherian wrote: > > On Wed, Sep 10, 2025 at 2:45 PM shveta malik wrote: > > > > On Tue, Sep 9, 2025 at 5:37 PM Ajin Cherian wrote: > > > > > > Attached v11 patch addressing the above comments. > > > > > > > Please find a few comments: > > > > 1) > > > > + Retr

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-15 Thread Ajin Cherian
On Wed, Sep 10, 2025 at 2:45 PM shveta malik wrote: > > On Tue, Sep 9, 2025 at 5:37 PM Ajin Cherian wrote: > > > > Attached v11 patch addressing the above comments. > > > > Please find a few comments: > > 1) > > + Retry is done after 2 > + * sec wait. Exits early if promotion is triggered or cert

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-09 Thread shveta malik
On Tue, Sep 9, 2025 at 5:37 PM Ajin Cherian wrote: > > Attached v11 patch addressing the above comments. > Please find a few comments: 1) + Retry is done after 2 + * sec wait. Exits early if promotion is triggered or certain critical We can say: Retry is done after SLOTSYNC_API_NAPTIME_MS wait

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-07 Thread Ashutosh Sharma
Hi, Sharing some of my review comments, please look if these make sense to you. On Wed, Sep 3, 2025 at 3:20 PM Ajin Cherian wrote: > > On Wed, Sep 3, 2025 at 6:47 PM shveta malik wrote: > > > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > Attaching v10 with the above changes

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-07 Thread shveta malik
On Fri, Sep 5, 2025 at 6:51 PM Ashutosh Bapat wrote: > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > On Fri, Aug 29, 2025 at 6:50 PM Ashutosh Bapat > > wrote: > > > > > > On Fri, Aug 29, 2025 at 11:42 AM Ajin Cherian wrote: > > > > > +/* > > > + * Flag used by pg_sync_replic

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-07 Thread Ashutosh Sharma
On Mon, Sep 8, 2025 at 9:51 AM Ashutosh Bapat wrote: > > On Sat, Sep 6, 2025 at 9:14 AM Amit Kapila wrote: > > > > On Fri, Sep 5, 2025 at 11:39 PM Ashutosh Sharma > > wrote: > > > If the remote slot is inactive since long and lagging behind the > > > standby, this function (pg_sync_replication_

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-07 Thread Ashutosh Bapat
On Sat, Sep 6, 2025 at 9:14 AM Amit Kapila wrote: > > On Fri, Sep 5, 2025 at 11:39 PM Ashutosh Sharma wrote: > > If the remote slot is inactive since long and lagging behind the > > standby, this function (pg_sync_replication_slots) could end up > > waiting indefinitely. While it can certainly be

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-07 Thread Ashutosh Bapat
On Sat, Sep 6, 2025 at 12:05 AM Ashutosh Sharma wrote: > > On Fri, Sep 5, 2025 at 6:52 PM Ashutosh Bapat > wrote: > > > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > I've tested this and I see that interrupts are being handled by > > > sending SIGQUIT and SIGINT to the backen

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-06 Thread shveta malik
On Wed, Sep 3, 2025 at 3:19 PM Ajin Cherian wrote: > > On Wed, Sep 3, 2025 at 6:47 PM shveta malik wrote: > > > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > Attaching v10 with the above changes. > > > > > > > The patch does not apply on HEAD. Can you please rebase? > > Rebas

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-05 Thread Amit Kapila
On Fri, Sep 5, 2025 at 11:39 PM Ashutosh Sharma wrote: > > On Wed, Sep 3, 2025 at 3:20 PM Ajin Cherian wrote: > > > > On Wed, Sep 3, 2025 at 6:47 PM shveta malik wrote: > > > > > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > > > Attaching v10 with the above changes. > > > >

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-05 Thread Ashutosh Sharma
Hi, On Wed, Sep 3, 2025 at 3:20 PM Ajin Cherian wrote: > > On Wed, Sep 3, 2025 at 6:47 PM shveta malik wrote: > > > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > Attaching v10 with the above changes. > > > > > > > The patch does not apply on HEAD. Can you please rebase? > >

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-05 Thread Ashutosh Sharma
On Fri, Sep 5, 2025 at 6:52 PM Ashutosh Bapat wrote: > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > > > On Fri, Aug 29, 2025 at 6:50 PM Ashutosh Bapat > > wrote: > > > > > > On Fri, Aug 29, 2025 at 11:42 AM Ajin Cherian wrote: > > > > > +/* > > > + * Flag used by pg_sync_replic

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-05 Thread Ashutosh Bapat
On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > On Fri, Aug 29, 2025 at 6:50 PM Ashutosh Bapat > wrote: > > > > On Fri, Aug 29, 2025 at 11:42 AM Ajin Cherian wrote: > > > +/* > > + * Flag used by pg_sync_replication_slots() > > + * to do retries if the slot did not persist while syncin

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-03 Thread Ajin Cherian
On Wed, Sep 3, 2025 at 6:47 PM shveta malik wrote: > > On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > > > Attaching v10 with the above changes. > > > > The patch does not apply on HEAD. Can you please rebase? Rebased and made a small change as well to use TopMemoryContext rather than cr

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-03 Thread shveta malik
On Wed, Sep 3, 2025 at 11:58 AM Ajin Cherian wrote: > > Attaching v10 with the above changes. > The patch does not apply on HEAD. Can you please rebase? thanks Shveta

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-09-02 Thread Ajin Cherian
On Fri, Aug 29, 2025 at 3:01 PM shveta malik wrote: > > On Tue, Aug 26, 2025 at 9:58 AM Ajin Cherian wrote: > > Thank You for the patches. Please find a few comments. > > 1) > Change not needed: > > * without waiting for SLOTSYNC_RESTART_INTERVAL_SEC. > + * > */ > Removed. > 2) > Regarding

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-31 Thread shveta malik
On Fri, Aug 29, 2025 at 4:14 PM Ashutosh Bapat wrote: > > On Fri, Aug 29, 2025 at 2:37 PM shveta malik wrote: > > > > On Fri, Aug 29, 2025 at 2:20 PM Ashutosh Bapat > > wrote: > > > > > > @@ -1276,7 +1331,7 @@ wait_for_slot_activity(bool some_slot_updated) > > > > > > The function is too cute to

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-29 Thread Ashutosh Bapat
On Fri, Aug 29, 2025 at 2:37 PM shveta malik wrote: > > On Fri, Aug 29, 2025 at 2:20 PM Ashutosh Bapat > wrote: > > > > @@ -1276,7 +1331,7 @@ wait_for_slot_activity(bool some_slot_updated) > > > > The function is too cute to be useful. The code should be part of > > ReplSlotSyncWorkerMain() just

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-29 Thread shveta malik
On Fri, Aug 29, 2025 at 2:20 PM Ashutosh Bapat wrote: > > On Fri, Aug 29, 2025 at 11:42 AM Ajin Cherian wrote: > > > > On Fri, Aug 29, 2025 at 3:01 PM shveta malik wrote: > > > > > > On Tue, Aug 26, 2025 at 9:58 AM Ajin Cherian wrote: > > > 4) > > > In the worker, before each call to synchroniz

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-29 Thread Ashutosh Bapat
On Fri, Aug 29, 2025 at 11:42 AM Ajin Cherian wrote: > > On Fri, Aug 29, 2025 at 3:01 PM shveta malik wrote: > > > > On Tue, Aug 26, 2025 at 9:58 AM Ajin Cherian wrote: > > 4) > > In the worker, before each call to synchronize_slots(), we are > > starting a new transaction. It aligns with the pr

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-28 Thread Ajin Cherian
On Fri, Aug 29, 2025 at 3:01 PM shveta malik wrote: > > On Tue, Aug 26, 2025 at 9:58 AM Ajin Cherian wrote: > 4) > In the worker, before each call to synchronize_slots(), we are > starting a new transaction. It aligns with the previous implementation > where StartTransaction was inside synchroniz

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-28 Thread shveta malik
On Tue, Aug 26, 2025 at 9:58 AM Ajin Cherian wrote: > > On Fri, Aug 22, 2025 at 3:44 PM shveta malik wrote: > > > > On Wed, Aug 20, 2025 at 10:53 AM Ajin Cherian wrote: > > > > > > > > > I've removed them. > > > Attaching patch v8 addressing the above comments. > > > > > > > Thanks for the patch

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-25 Thread Ajin Cherian
On Fri, Aug 22, 2025 at 3:44 PM shveta malik wrote: > > On Wed, Aug 20, 2025 at 10:53 AM Ajin Cherian wrote: > > > > > > I've removed them. > > Attaching patch v8 addressing the above comments. > > > > Thanks for the patch. Please find a few comments: > > 1) > When the API is in progress, and mea

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-21 Thread shveta malik
On Wed, Aug 20, 2025 at 10:53 AM Ajin Cherian wrote: > > > I've removed them. > Attaching patch v8 addressing the above comments. > Thanks for the patch. Please find a few comments: 1) When the API is in progress, and meanwhile in another session we turn off hot_standby_feedback, the API session

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-19 Thread Ajin Cherian
On Tue, Aug 19, 2025 at 8:57 PM Kirill Reshke wrote: > > On Tue, 19 Aug 2025 at 10:25, Ajin Cherian wrote: > > > > > Attaching patch v7 addressing all the above comments. > > > Looks like this thread is not attached to any commitfest entry? > If so, can you please create one[0]? This will be bene

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-19 Thread Ajin Cherian
On Tue, Aug 19, 2025 at 7:42 PM shveta malik wrote: > > On Tue, Aug 19, 2025 at 10:55 AM Ajin Cherian wrote: > > > > Attaching patch v7 addressing all the above comments. > > > > Thank You for the patches. Please find a few comments: > > 1) > We are not resetting 'slot_persistence_pending' to fal

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-19 Thread Kirill Reshke
On Tue, 19 Aug 2025 at 10:25, Ajin Cherian wrote: > > Attaching patch v7 addressing all the above comments. Looks like this thread is not attached to any commitfest entry? If so, can you please create one[0]? This will be beneficial for thread, both simplifying patch review and (possibly) incre

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-19 Thread shveta malik
On Tue, Aug 19, 2025 at 10:55 AM Ajin Cherian wrote: > > Attaching patch v7 addressing all the above comments. > Thank You for the patches. Please find a few comments: 1) We are not resetting 'slot_persistence_pending' to false anywhere. So once it hits the flow which sets it to true, it will ne

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-18 Thread Ajin Cherian
On Thu, Aug 14, 2025 at 4:44 PM shveta malik wrote: > > On Thu, Aug 14, 2025 at 7:28 AM Ajin Cherian wrote: > > > > > > Patch v6 attached. > > > > Thanks Ajin. Please find my comments: > > 1) > SyncReplicationSlots: > + remote_slots = fetch_or_refresh_remote_slots(wrconn, NIL); > + > + /* Retry u

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-14 Thread Ashutosh Bapat
On Thu, Aug 14, 2025 at 12:14 PM shveta malik wrote: > > > 8) > + /* If refreshing, free the original list structures */ > + if (is_refresh) > + { > + foreach(lc, remote_slot_list) > + { > + RemoteSlot *old_slot = (RemoteSlot *) lfirst(lc); > + pfree(old_slot); > + } > + list_free(remote_slot_list

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-13 Thread shveta malik
On Thu, Aug 14, 2025 at 7:28 AM Ajin Cherian wrote: > > > Patch v6 attached. > Thanks Ajin. Please find my comments: 1) SyncReplicationSlots: + remote_slots = fetch_or_refresh_remote_slots(wrconn, NIL); + + /* Retry until all slots are sync ready atleast */ + for (;;) + { + bool some_slot_update

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-13 Thread Ajin Cherian
On Wed, Aug 13, 2025 at 2:47 PM shveta malik wrote: > > On Mon, Aug 11, 2025 at 1:37 PM Ajin Cherian wrote: > > > > On Fri, Aug 8, 2025 at 11:22 PM Ashutosh Bapat > > wrote: > > > > > > > > > There's also a minor merge conflict because func.sgml is not split > > > into multiple files. > > > > >

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-12 Thread shveta malik
On Mon, Aug 11, 2025 at 1:37 PM Ajin Cherian wrote: > > On Fri, Aug 8, 2025 at 11:22 PM Ashutosh Bapat > wrote: > > > > > > There's also a minor merge conflict because func.sgml is not split > > into multiple files. > > > > Yes, I fixed this. > Thanks for the patch. Please find a few comments:

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-11 Thread Ajin Cherian
On Fri, Aug 8, 2025 at 11:22 PM Ashutosh Bapat wrote: > > > There's also a minor merge conflict because func.sgml is not split > into multiple files. > Yes, I fixed this. regards, Ajin Cherian Fujitsu Australia

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-11 Thread Ajin Cherian
On Tue, Aug 5, 2025 at 4:22 PM Amit Kapila wrote: > > On Tue, Aug 5, 2025 at 9:28 AM shveta malik wrote: > > > > On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila wrote: > > > > > > On Mon, Aug 4, 2025 at 12:19 PM shveta malik > > > wrote: > > > > If we want to avoid continuously syncing newly added

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-08 Thread Ashutosh Bapat
On Wed, Aug 6, 2025 at 8:48 AM shveta malik wrote: > > On Wed, Aug 6, 2025 at 7:35 AM Ajin Cherian wrote: > > > > On Tue, Aug 5, 2025 at 4:22 PM Amit Kapila wrote: > > > > > > On Tue, Aug 5, 2025 at 9:28 AM shveta malik > > > wrote: > > > > > > > > On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-05 Thread shveta malik
On Wed, Aug 6, 2025 at 7:35 AM Ajin Cherian wrote: > > On Tue, Aug 5, 2025 at 4:22 PM Amit Kapila wrote: > > > > On Tue, Aug 5, 2025 at 9:28 AM shveta malik wrote: > > > > > > On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila > > > wrote: > > > > > > > > On Mon, Aug 4, 2025 at 12:19 PM shveta malik

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-05 Thread Ajin Cherian
On Tue, Aug 5, 2025 at 4:22 PM Amit Kapila wrote: > > On Tue, Aug 5, 2025 at 9:28 AM shveta malik wrote: > > > > On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila wrote: > > > > > > On Mon, Aug 4, 2025 at 12:19 PM shveta malik > > > wrote: > > > > If we want to avoid continuously syncing newly added

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-05 Thread Ajin Cherian
On Fri, Aug 1, 2025 at 4:32 PM shveta malik wrote: > > > Thanks for the patch. I tested it, please find a few comments: > > > 1) > it hits an assert > (slotsync_reread_config()-->Assert(sync_replication_slots)) when API > is trying to sync and is in wait loop while in another session, I > enable s

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-04 Thread Amit Kapila
On Tue, Aug 5, 2025 at 9:28 AM shveta malik wrote: > > On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila wrote: > > > > On Mon, Aug 4, 2025 at 12:19 PM shveta malik wrote: > > If we want to avoid continuously syncing newly added slots in later > cycles and instead focus only on the ones that failed to

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-04 Thread shveta malik
On Mon, Aug 4, 2025 at 3:41 PM Amit Kapila wrote: > > On Mon, Aug 4, 2025 at 12:19 PM shveta malik wrote: > > > > On Mon, Aug 4, 2025 at 11:31 AM Amit Kapila wrote: > > > > > > On Fri, Aug 1, 2025 at 2:50 PM shveta malik > > > wrote: > > > > > > > > 5) > > > > I tried a test where there were 4

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-04 Thread Amit Kapila
On Mon, Aug 4, 2025 at 12:19 PM shveta malik wrote: > > On Mon, Aug 4, 2025 at 11:31 AM Amit Kapila wrote: > > > > On Fri, Aug 1, 2025 at 2:50 PM shveta malik wrote: > > > > > > 5) > > > I tried a test where there were 4 slots on the publisher, where one > > > was getting used while the others w

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-03 Thread shveta malik
On Mon, Aug 4, 2025 at 11:31 AM Amit Kapila wrote: > > On Fri, Aug 1, 2025 at 2:50 PM shveta malik wrote: > > > > 5) > > I tried a test where there were 4 slots on the publisher, where one > > was getting used while the others were not. Initiated > > pg_sync_replication_slots on standby. Forced u

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-03 Thread Amit Kapila
On Fri, Aug 1, 2025 at 2:50 PM shveta malik wrote: > > 5) > I tried a test where there were 4 slots on the publisher, where one > was getting used while the others were not. Initiated > pg_sync_replication_slots on standby. Forced unused slots to be > invalidated by setting idle_replication_slot_t

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-08-01 Thread shveta malik
On Fri, Aug 1, 2025 at 12:02 PM shveta malik wrote: > > On Thu, Jul 31, 2025 at 3:11 PM Ajin Cherian wrote: > > > > > > Patch v3 attached. > > > > Thanks for the patch. I tested it, please find a few comments: > > > 1) > it hits an assert > (slotsync_reread_config()-->Assert(sync_replication_slot

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-31 Thread shveta malik
On Thu, Jul 31, 2025 at 3:11 PM Ajin Cherian wrote: > > > Patch v3 attached. > Thanks for the patch. I tested it, please find a few comments: 1) it hits an assert (slotsync_reread_config()-->Assert(sync_replication_slots)) when API is trying to sync and is in wait loop while in another session,

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-31 Thread Ajin Cherian
On Thu, Jul 17, 2025 at 2:04 PM shveta malik wrote: > > On Wed, Jul 16, 2025 at 3:47 PM Ajin Cherian wrote: > > > > > I am not able to apply the patch to the latest head or even to a week > > > back version. Can you please check and rebase? > > > > > > thanks > > > Shveta > > > > Rebased. > > > >

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-20 Thread Dilip Kumar
On Mon, Jul 21, 2025 at 10:08 AM shveta malik wrote: > > On Sat, Jul 19, 2025 at 5:10 PM Amit Kapila wrote: > > > > On Fri, Jul 18, 2025 at 11:31 AM Dilip Kumar wrote: > > > > > > On Fri, Jul 18, 2025 at 11:25 AM shveta malik > > > wrote: > > > > > > > > Okay. I see your point. Yes, it was no

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-20 Thread Amit Kapila
On Mon, Jul 21, 2025 at 10:08 AM shveta malik wrote: > > On Sat, Jul 19, 2025 at 5:10 PM Amit Kapila wrote: > > > > On Fri, Jul 18, 2025 at 11:31 AM Dilip Kumar wrote: > > > > > > On Fri, Jul 18, 2025 at 11:25 AM shveta malik > > > wrote: > > > > > > > > Okay. I see your point. Yes, it was no

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-20 Thread shveta malik
On Sat, Jul 19, 2025 at 5:10 PM Amit Kapila wrote: > > On Fri, Jul 18, 2025 at 11:31 AM Dilip Kumar wrote: > > > > On Fri, Jul 18, 2025 at 11:25 AM shveta malik > > wrote: > > > > > > Okay. I see your point. Yes, it was non-blocking earlier but it was > > > not giving ERROR, it was just dumpin

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-19 Thread Amit Kapila
On Fri, Jul 18, 2025 at 11:31 AM Dilip Kumar wrote: > > On Fri, Jul 18, 2025 at 11:25 AM shveta malik wrote: > > > > Okay. I see your point. Yes, it was non-blocking earlier but it was > > not giving ERROR, it was just dumping in logilfe that primary is > > behind and thus slot-sync could not be

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-17 Thread Dilip Kumar
On Fri, Jul 18, 2025 at 11:25 AM shveta malik wrote: > > Okay. I see your point. Yes, it was non-blocking earlier but it was > not giving ERROR, it was just dumping in logilfe that primary is > behind and thus slot-sync could not be done. > > If we continue using the non-blocking mode, there’s a

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-17 Thread shveta malik
On Fri, Jul 18, 2025 at 10:52 AM Dilip Kumar wrote: > > On Fri, Jul 18, 2025 at 10:45 AM shveta malik wrote: > > > > On Fri, Jul 18, 2025 at 10:14 AM Dilip Kumar wrote: > > > > > > On Thu, Jul 17, 2025 at 9:34 AM shveta malik > > > wrote: > > > > > > > > On Wed, Jul 16, 2025 at 3:47 PM Ajin Ch

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-17 Thread Dilip Kumar
On Fri, Jul 18, 2025 at 10:45 AM shveta malik wrote: > > On Fri, Jul 18, 2025 at 10:14 AM Dilip Kumar wrote: > > > > On Thu, Jul 17, 2025 at 9:34 AM shveta malik wrote: > > > > > > On Wed, Jul 16, 2025 at 3:47 PM Ajin Cherian wrote: > > > > > > > > > I am not able to apply the patch to the late

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-17 Thread shveta malik
On Fri, Jul 18, 2025 at 10:14 AM Dilip Kumar wrote: > > On Thu, Jul 17, 2025 at 9:34 AM shveta malik wrote: > > > > On Wed, Jul 16, 2025 at 3:47 PM Ajin Cherian wrote: > > > > > > > I am not able to apply the patch to the latest head or even to a week > > > > back version. Can you please check a

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-17 Thread Dilip Kumar
On Thu, Jul 17, 2025 at 9:34 AM shveta malik wrote: > > On Wed, Jul 16, 2025 at 3:47 PM Ajin Cherian wrote: > > > > > I am not able to apply the patch to the latest head or even to a week > > > back version. Can you please check and rebase? > > > > > > thanks > > > Shveta > > > > Rebased. > > > >

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-16 Thread shveta malik
On Wed, Jul 16, 2025 at 3:47 PM Ajin Cherian wrote: > > > I am not able to apply the patch to the latest head or even to a week > > back version. Can you please check and rebase? > > > > thanks > > Shveta > > Rebased. > Thanks. Please find a few comments: 1) /* Any slot with NULL in these field

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-16 Thread Ajin Cherian
> I am not able to apply the patch to the latest head or even to a week > back version. Can you please check and rebase? > > thanks > Shveta Rebased. Regards, Ajin Cherian Fujitsu Australia. v2-0001-Improve-initial-slot-synchronization-in-pg_sync_r.patch Description: Binary data

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-16 Thread shveta malik
On Wed, Jul 16, 2025 at 3:00 PM Ajin Cherian wrote: > > On Wed, Jul 2, 2025 at 7:56 PM shveta malik wrote: > > > > Few comments: > > > > 1) > > When the API is waiting for the primary to advance, standby fails to > > handle promotion requests. Promotion fails: > > ./pg_ctl -D ../../standbydb/ pro

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-16 Thread Ajin Cherian
On Wed, Jul 2, 2025 at 7:56 PM shveta malik wrote: > > Few comments: > > 1) > When the API is waiting for the primary to advance, standby fails to > handle promotion requests. Promotion fails: > ./pg_ctl -D ../../standbydb/ promote -w > waiting for server to promote.stopped waiting

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-08 Thread shveta malik
Please find few more comments: 1) In pg_sync_replication_slots() doc, we have this: "Note that this function is primarily intended for testing and debugging purposes and should be used with caution. Additionally, this function cannot be executed if " We can get rid of this info as well and

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-07-02 Thread shveta malik
On Tue, Jun 24, 2025 at 4:11 PM Ajin Cherian wrote: > > Hello, > > Creating this thread for a POC based on discussions in thread [1]. > Hou-san had created this patch, and I just cleaned up some documents, > did some testing and now sharing the patch here. > > In this patch, the pg_sync_replicatio

Re: Improve pg_sync_replication_slots() to wait for primary to advance

2025-06-25 Thread Ajin Cherian
Sorry, I attached the wrong file. Attaching the correct file now. regards, Ajin Cerian Fujitsu Australia 0001-Improve-initial-slot-synchronization-in-pg_sync_repl.patch Description: Binary data

Improve pg_sync_replication_slots() to wait for primary to advance

2025-06-24 Thread Ajin Cherian
Hello, Creating this thread for a POC based on discussions in thread [1]. Hou-san had created this patch, and I just cleaned up some documents, did some testing and now sharing the patch here. In this patch, the pg_sync_replication_slots() API now waits indefinitely for the remote slot to catch u