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