Re: Synchronizing slots from primary to standby

2023-10-09 Thread shveta malik
On Wed, Oct 4, 2023 at 8:53 AM Peter Smith wrote: > > Here are some review comments for v20-0002. > Thanks Peter for the feedback. Comments from 31 till end are addressed in v22. First 30 comments will be addressed in the next version. > == > 1. GENERAL - errmsg/elog messages > > There are

Re: Synchronizing slots from primary to standby

2023-10-08 Thread Amit Kapila
On Mon, Oct 9, 2023 at 10:51 AM Drouvot, Bertrand wrote: > > I like the idea and I think that's the one that seems the more reasonable > to me. I'd vote for this idea with: > > - standby_slot_names on the primary (could also be set on standbys in case of > cascading context) > - enable_failover

Re: Synchronizing slots from primary to standby

2023-10-08 Thread Drouvot, Bertrand
Hi, On 10/6/23 6:48 PM, Amit Kapila wrote: On Wed, Oct 4, 2023 at 5:34 PM Drouvot, Bertrand wrote: On 10/4/23 1:50 PM, shveta malik wrote: On Wed, Oct 4, 2023 at 5:00 PM Amit Kapila wrote: On Wed, Oct 4, 2023 at 11:55 AM Drouvot, Bertrand wrote: On 10/4/23 6:26 AM, shveta malik wrote:

Re: Synchronizing slots from primary to standby

2023-10-08 Thread Peter Smith
On Fri, Oct 6, 2023 at 7:37 PM Alvaro Herrera wrote: > > On 2023-Sep-27, Peter Smith wrote: > > > 3. get_local_synced_slot_names > > > > + for (int i = 0; i < max_replication_slots; i++) > > + { > > + ReplicationSlot *s = >replication_slots[i]; > > + > > + /* Check if it is logical synchronized

Re: Synchronizing slots from primary to standby

2023-10-06 Thread Amit Kapila
On Wed, Oct 4, 2023 at 5:34 PM Drouvot, Bertrand wrote: > > On 10/4/23 1:50 PM, shveta malik wrote: > > On Wed, Oct 4, 2023 at 5:00 PM Amit Kapila wrote: > >> > >> On Wed, Oct 4, 2023 at 11:55 AM Drouvot, Bertrand > >> wrote: > >>> > >>> On 10/4/23 6:26 AM, shveta malik wrote: > On Wed,

Re: Synchronizing slots from primary to standby

2023-10-06 Thread shveta malik
On Fri, Oct 6, 2023 at 2:07 PM Alvaro Herrera wrote: > > On 2023-Sep-27, Peter Smith wrote: > > > 3. get_local_synced_slot_names > > > > + for (int i = 0; i < max_replication_slots; i++) > > + { > > + ReplicationSlot *s = >replication_slots[i]; > > + > > + /* Check if it is logical synchronized

Re: Synchronizing slots from primary to standby

2023-10-06 Thread Alvaro Herrera
On 2023-Sep-27, Peter Smith wrote: > 3. get_local_synced_slot_names > > + for (int i = 0; i < max_replication_slots; i++) > + { > + ReplicationSlot *s = >replication_slots[i]; > + > + /* Check if it is logical synchronized slot */ > + if (s->in_use && SlotIsLogical(s) && s->data.synced) > + { >

Re: Synchronizing slots from primary to standby

2023-10-05 Thread Peter Smith
Hi Ajin. Thanks for addressing my previous review comments from v19. I checked all the changes. Below are a few follow-up remarks. On Thu, Oct 5, 2023 at 7:54 PM Ajin Cherian wrote: > > On Wed, Sep 27, 2023 at 2:37 PM Peter Smith wrote: > > > > Here are some more review comments for the patch

Re: Synchronizing slots from primary to standby

2023-10-04 Thread Drouvot, Bertrand
Hi, On 10/4/23 1:50 PM, shveta malik wrote: On Wed, Oct 4, 2023 at 5:00 PM Amit Kapila wrote: On Wed, Oct 4, 2023 at 11:55 AM Drouvot, Bertrand wrote: On 10/4/23 6:26 AM, shveta malik wrote: On Wed, Oct 4, 2023 at 5:36 AM Amit Kapila wrote: How about an alternate scheme where we

Re: Synchronizing slots from primary to standby

2023-10-04 Thread shveta malik
On Wed, Oct 4, 2023 at 12:08 PM Drouvot, Bertrand wrote: > > Hi, > > On 10/4/23 7:00 AM, shveta malik wrote: > > On Wed, Oct 4, 2023 at 9:56 AM shveta malik wrote: > > > The most simplistic approach would be: > > > > 1) maintain standby_slot_names GUC on primary > > 2) maintain

Re: Synchronizing slots from primary to standby

2023-10-04 Thread shveta malik
On Wed, Oct 4, 2023 at 5:00 PM Amit Kapila wrote: > > On Wed, Oct 4, 2023 at 11:55 AM Drouvot, Bertrand > wrote: > > > > On 10/4/23 6:26 AM, shveta malik wrote: > > > On Wed, Oct 4, 2023 at 5:36 AM Amit Kapila > > > wrote: > > >> > > >> > > >> How about an alternate scheme where we define

Re: Synchronizing slots from primary to standby

2023-10-04 Thread Amit Kapila
On Wed, Oct 4, 2023 at 11:55 AM Drouvot, Bertrand wrote: > > On 10/4/23 6:26 AM, shveta malik wrote: > > On Wed, Oct 4, 2023 at 5:36 AM Amit Kapila wrote: > >> > >> > >> How about an alternate scheme where we define sync_slot_names on > >> standby but then store the physical_slot_name in the

Re: Synchronizing slots from primary to standby

2023-10-04 Thread Drouvot, Bertrand
Hi, On 10/4/23 7:00 AM, shveta malik wrote: On Wed, Oct 4, 2023 at 9:56 AM shveta malik wrote: The most simplistic approach would be: 1) maintain standby_slot_names GUC on primary 2) maintain synchronize_slot_names GUC on physical standby alone. On primary, let all logical-walsenders wait

Re: Synchronizing slots from primary to standby

2023-10-04 Thread Drouvot, Bertrand
Hi, On 10/4/23 6:26 AM, shveta malik wrote: On Wed, Oct 4, 2023 at 5:36 AM Amit Kapila wrote: On Tue, Oct 3, 2023 at 9:27 PM shveta malik wrote: On Tue, Oct 3, 2023 at 7:56 PM Drouvot, Bertrand wrote: Hi, On 10/3/23 12:54 PM, Amit Kapila wrote: On Mon, Oct 2, 2023 at 11:39 AM

Re: Synchronizing slots from primary to standby

2023-10-03 Thread shveta malik
On Mon, Oct 2, 2023 at 4:29 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Shveta, > > Thank you for updating the patch! > > I found another ERROR due to the slot removal. Is this a real issue? > > 1. applied add_sleep.txt, which emulated the case the tablesync worker stucked >and the primary

Re: Synchronizing slots from primary to standby

2023-10-03 Thread shveta malik
On Wed, Oct 4, 2023 at 9:56 AM shveta malik wrote: > > On Wed, Oct 4, 2023 at 5:36 AM Amit Kapila wrote: > > > > On Tue, Oct 3, 2023 at 9:27 PM shveta malik wrote: > > > > > > On Tue, Oct 3, 2023 at 7:56 PM Drouvot, Bertrand > > > wrote: > > > > > > > > Hi, > > > > > > > > On 10/3/23 12:54 PM,

Re: Synchronizing slots from primary to standby

2023-10-03 Thread shveta malik
On Wed, Oct 4, 2023 at 5:36 AM Amit Kapila wrote: > > On Tue, Oct 3, 2023 at 9:27 PM shveta malik wrote: > > > > On Tue, Oct 3, 2023 at 7:56 PM Drouvot, Bertrand > > wrote: > > > > > > Hi, > > > > > > On 10/3/23 12:54 PM, Amit Kapila wrote: > > > > On Mon, Oct 2, 2023 at 11:39 AM Drouvot,

Re: Synchronizing slots from primary to standby

2023-10-03 Thread Peter Smith
Here are some review comments for v20-0002. == 1. GENERAL - errmsg/elog messages There are a a lot of minor problems and/or quirks across all the message texts. Here is a summary of some I found: ERROR errmsg("could not receive list of slots from the primary server: %s", errmsg("invalid

Re: Synchronizing slots from primary to standby

2023-10-03 Thread Amit Kapila
On Tue, Oct 3, 2023 at 9:27 PM shveta malik wrote: > > On Tue, Oct 3, 2023 at 7:56 PM Drouvot, Bertrand > wrote: > > > > Hi, > > > > On 10/3/23 12:54 PM, Amit Kapila wrote: > > > On Mon, Oct 2, 2023 at 11:39 AM Drouvot, Bertrand > > > wrote: > > >> > > >> On 9/29/23 1:33 PM, Amit Kapila wrote:

Re: Synchronizing slots from primary to standby

2023-10-03 Thread shveta malik
On Tue, Oct 3, 2023 at 7:56 PM Drouvot, Bertrand wrote: > > Hi, > > On 10/3/23 12:54 PM, Amit Kapila wrote: > > On Mon, Oct 2, 2023 at 11:39 AM Drouvot, Bertrand > > wrote: > >> > >> On 9/29/23 1:33 PM, Amit Kapila wrote: > >>> On Thu, Sep 28, 2023 at 6:31 PM Drouvot, Bertrand > >>> wrote: >

Re: Synchronizing slots from primary to standby

2023-10-03 Thread Drouvot, Bertrand
Hi, On 10/3/23 12:54 PM, Amit Kapila wrote: On Mon, Oct 2, 2023 at 11:39 AM Drouvot, Bertrand wrote: On 9/29/23 1:33 PM, Amit Kapila wrote: On Thu, Sep 28, 2023 at 6:31 PM Drouvot, Bertrand wrote: - probably open corner cases like: what if a standby is down? would that mean that

Re: Synchronizing slots from primary to standby

2023-10-03 Thread Amit Kapila
On Mon, Oct 2, 2023 at 11:39 AM Drouvot, Bertrand wrote: > > On 9/29/23 1:33 PM, Amit Kapila wrote: > > On Thu, Sep 28, 2023 at 6:31 PM Drouvot, Bertrand > > wrote: > >> > > > >> - probably open corner cases like: what if a standby is down? would that > >> mean > >> that synchronize_slot_names

Re: Synchronizing slots from primary to standby

2023-10-02 Thread Drouvot, Bertrand
Hi, On 9/29/23 1:33 PM, Amit Kapila wrote: On Thu, Sep 28, 2023 at 6:31 PM Drouvot, Bertrand wrote: I think that standby_slot_names could be used to do some filtering (means for which standby(s) we don't want the logical replication on the primary to go ahead and for which standby(s) one

Re: Synchronizing slots from primary to standby

2023-09-29 Thread Amit Kapila
On Thu, Sep 28, 2023 at 6:31 PM Drouvot, Bertrand wrote: > > On 9/25/23 6:10 AM, shveta malik wrote: > > On Fri, Sep 22, 2023 at 3:48 PM Amit Kapila wrote: > >> > >> On Thu, Sep 21, 2023 at 9:16 AM shveta malik > >> wrote: > >>> > >>> On Tue, Sep 19, 2023 at 10:29 AM shveta malik > >>>

Re: Synchronizing slots from primary to standby

2023-09-28 Thread Drouvot, Bertrand
Hi, On 9/25/23 6:10 AM, shveta malik wrote: On Fri, Sep 22, 2023 at 3:48 PM Amit Kapila wrote: On Thu, Sep 21, 2023 at 9:16 AM shveta malik wrote: On Tue, Sep 19, 2023 at 10:29 AM shveta malik wrote: Currently in patch001, synchronize_slot_names is a GUC on both primary and physical

Re: Synchronizing slots from primary to standby

2023-09-27 Thread Amit Kapila
On Wed, Sep 27, 2023 at 3:13 PM Drouvot, Bertrand wrote: > > On 9/19/23 6:50 AM, shveta malik wrote: > > > > 1) patch001: wait for physical-standby confirmation logic is now > > integrated with WalSndWaitForWal(). Now walsender waits for physical > > standby's confirmation to take changes upto

Re: Synchronizing slots from primary to standby

2023-09-27 Thread shveta malik
On Mon, Sep 25, 2023 at 7:46 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Ajin, Shveta, > > Thank you for rebasing the patch set! Here are new comments for v19_2-0001. > Thank You Kuroda-san for the feedback. Most of these are addressed in v20. Please find my response inline. > 01.

Re: Synchronizing slots from primary to standby

2023-09-27 Thread Drouvot, Bertrand
Hi, On 9/19/23 6:50 AM, shveta malik wrote: On Wed, Sep 13, 2023 at 5:19 PM Amit Kapila wrote: On Wed, Sep 13, 2023 at 4:54 PM shveta malik wrote: PFA v17. It has below changes: @@ -2498,6 +2500,13 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, } else {

Re: Synchronizing slots from primary to standby

2023-09-26 Thread Peter Smith
Here are some more review comments for the patch v19-0002. This is a WIP these review comments are all for the file slotsync.c == src/backend/replication/logical/slotsync.c 1. wait_for_primary_slot_catchup + WalRcvExecResult *res; + TupleTableSlot *slot; + Oid slotRow[1] = {LSNOID}; +

Re: Synchronizing slots from primary to standby

2023-09-25 Thread Drouvot, Bertrand
Hi, On 9/25/23 10:44 AM, Drouvot, Bertrand wrote: Hi, On 9/23/23 3:38 AM, Amit Kapila wrote: On Fri, Sep 22, 2023 at 6:01 PM Drouvot, Bertrand wrote: There is a difference here that we also need to prevent removal of rows required by sync_slots. That could be achieved by physical slot

RE: Synchronizing slots from primary to standby

2023-09-25 Thread Hayato Kuroda (Fujitsu)
Dear Ajin, Shveta, Thank you for rebasing the patch set! Here are new comments for v19_2-0001. 01. WalSndWaitForStandbyNeeded() ``` if (SlotIsPhysical(MyReplicationSlot)) return false; ``` Is there a possibility that physical walsenders call this function? IIUC

Re: Synchronizing slots from primary to standby

2023-09-25 Thread Drouvot, Bertrand
Hi, On 9/23/23 3:38 AM, Amit Kapila wrote: On Fri, Sep 22, 2023 at 6:01 PM Drouvot, Bertrand wrote: Thanks for all the work that has been done on this feature, and sorry to have been quiet on it for so long. On 9/18/23 12:22 PM, shveta malik wrote: On Wed, Sep 13, 2023 at 4:48 PM Hayato

Re: Synchronizing slots from primary to standby

2023-09-24 Thread shveta malik
On Fri, Sep 22, 2023 at 3:48 PM Amit Kapila wrote: > > On Thu, Sep 21, 2023 at 9:16 AM shveta malik wrote: > > > > On Tue, Sep 19, 2023 at 10:29 AM shveta malik > > wrote: > > > > Currently in patch001, synchronize_slot_names is a GUC on both primary > > and physical standby. This GUC tells

Re: Synchronizing slots from primary to standby

2023-09-24 Thread shveta malik
On Fri, Sep 22, 2023 at 6:01 PM Drouvot, Bertrand wrote: > > Hi, > > Thanks for all the work that has been done on this feature, and sorry > to have been quiet on it for so long. Thanks for looking into this. > > On 9/18/23 12:22 PM, shveta malik wrote: > > On Wed, Sep 13, 2023 at 4:48 PM

Re: Synchronizing slots from primary to standby

2023-09-24 Thread Peter Smith
FYI -- v19 failed to apply cleanly with the latest HEAD. [postgres@CentOS7-x64 oss_postgres_misc]$ git apply ../patches_misc/v19-0001-Allow-logical-walsenders-to-wait-for-physical-st.patch error: patch failed: src/test/recovery/meson.build:44 error: src/test/recovery/meson.build: patch does not

Re: Synchronizing slots from primary to standby

2023-09-22 Thread Amit Kapila
On Fri, Sep 22, 2023 at 6:01 PM Drouvot, Bertrand wrote: > > Thanks for all the work that has been done on this feature, and sorry > to have been quiet on it for so long. > > On 9/18/23 12:22 PM, shveta malik wrote: > > On Wed, Sep 13, 2023 at 4:48 PM Hayato Kuroda (Fujitsu) > > wrote: > >>

Re: Synchronizing slots from primary to standby

2023-09-22 Thread Drouvot, Bertrand
Hi, Thanks for all the work that has been done on this feature, and sorry to have been quiet on it for so long. On 9/18/23 12:22 PM, shveta malik wrote: On Wed, Sep 13, 2023 at 4:48 PM Hayato Kuroda (Fujitsu) wrote: Right, but I wanted to know why it is needed. One motivation seemed to know

Re: Synchronizing slots from primary to standby

2023-09-22 Thread Amit Kapila
On Thu, Sep 21, 2023 at 9:16 AM shveta malik wrote: > > On Tue, Sep 19, 2023 at 10:29 AM shveta malik wrote: > > Currently in patch001, synchronize_slot_names is a GUC on both primary > and physical standby. This GUC tells which all logical slots need to > be synced on physical standbys from the

Re: Synchronizing slots from primary to standby

2023-09-20 Thread shveta malik
On Tue, Sep 19, 2023 at 10:29 AM shveta malik wrote: > > On Fri, Sep 15, 2023 at 2:22 PM Peter Smith wrote: > > > > Hi. Here are some review comments for v17-0002. > > > > Thanks Peter for the feedback. I have addressed most of these in v18 > except 2. Please find my comments for the ones not

Re: Synchronizing slots from primary to standby

2023-09-18 Thread shveta malik
On Fri, Sep 15, 2023 at 2:22 PM Peter Smith wrote: > > Hi. Here are some review comments for v17-0002. > Thanks Peter for the feedback. I have addressed most of these in v18 except 2. Please find my comments for the ones not addressed. > This is a WIP and a long way from complete, but I

Re: Synchronizing slots from primary to standby

2023-09-18 Thread shveta malik
On Wed, Sep 13, 2023 at 4:48 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Shveta, > > Sorry for the late response. > > > Thanks Kuroda-san for the feedback. > > > > > > 01. General > > > > > > I think the documentation can be added, not only GUCs. How about adding > > examples > > > for

Re: Synchronizing slots from primary to standby

2023-09-15 Thread Peter Smith
Hi. Here are some review comments for v17-0002. This is a WIP and a long way from complete, but I wanted to send what I have so far (while it is still current with your latest posted patches). == 1. GENERAL - loop variable declaration There are some code examples like below where the loop

Re: Synchronizing slots from primary to standby

2023-09-13 Thread Amit Kapila
On Wed, Sep 13, 2023 at 4:54 PM shveta malik wrote: > > PFA v17. It has below changes: > @@ -2498,6 +2500,13 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, } else { + /* + * Before we send out the last set of changes to logical decoding + * output plugin, wait for

Re: Synchronizing slots from primary to standby

2023-09-13 Thread shveta malik
On Wed, Sep 6, 2023 at 2:18 PM shveta malik wrote: > > On Fri, Sep 1, 2023 at 1:59 PM Peter Smith wrote: > > > > Hi Shveta. Here are some comments for patch v14-0002 > > > > The patch is large, so my code review is a WIP... more later next week... > > > > Thanks Peter for the feedback. I have

RE: Synchronizing slots from primary to standby

2023-09-13 Thread Hayato Kuroda (Fujitsu)
Dear Shveta, Sorry for the late response. > Thanks Kuroda-san for the feedback. > > > > 01. General > > > > I think the documentation can be added, not only GUCs. How about adding > examples > > for combinations of physical and logical replications? You can say that > > both of > > physical

Re: Synchronizing slots from primary to standby

2023-09-10 Thread shveta malik
On Fri, Sep 8, 2023 at 4:40 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Shveta, > > I resumed to check the thread. Here are my high-level comments. > Sorry if you have been already discussed. Thanks Kuroda-san for the feedback. > > 01. General > > I think the documentation can be added, not only

RE: Synchronizing slots from primary to standby

2023-09-08 Thread Hayato Kuroda (Fujitsu)
Dear Shveta, I resumed to check the thread. Here are my high-level comments. Sorry if you have been already discussed. 01. General I think the documentation can be added, not only GUCs. How about adding examples for combinations of physical and logical replications? You can say that both of

Re: Synchronizing slots from primary to standby

2023-09-06 Thread shveta malik
On Fri, Aug 25, 2023 at 2:15 PM Alvaro Herrera wrote: > > Wait a minute ... > > From bac0fbef8b203c530e5117b0b7cfee13cfab78b9 Mon Sep 17 00:00:00 2001 > From: Bharath Rupireddy > Date: Sat, 22 Jul 2023 10:17:48 + > Subject: [PATCH v13 1/2] Allow logical walsenders to wait for physical >

Re: Synchronizing slots from primary to standby

2023-09-06 Thread shveta malik
On Fri, Sep 1, 2023 at 1:59 PM Peter Smith wrote: > > Hi Shveta. Here are some comments for patch v14-0002 > > The patch is large, so my code review is a WIP... more later next week... > Thanks Peter for the feedback. I have tried to address most of these in v15. Please find my response inline

Re: Synchronizing slots from primary to standby

2023-09-01 Thread Peter Smith
Hi Shveta. Here are some comments for patch v14-0002 The patch is large, so my code review is a WIP... more later next week... == GENERAL 1. Patch size The patch is 2700 lines. Is it possible to break this up into smaller self-contained parts to make the reviews more manageable? ~~~ 2.

Re: Synchronizing slots from primary to standby

2023-08-29 Thread shveta malik
On Wed, Aug 23, 2023 at 4:21 PM Dilip Kumar wrote: > > On Wed, Aug 23, 2023 at 3:38 PM shveta malik wrote: > > > I have reviewed the v12-0002 patch and I have some comments. I see the > latest version posted sometime back and if any of this comment is > already fixed in this version then feel

Re: Synchronizing slots from primary to standby

2023-08-29 Thread shveta malik
On Fri, Aug 25, 2023 at 11:09 AM shveta malik wrote: > > On Wed, Aug 23, 2023 at 4:21 PM Dilip Kumar wrote: > > > > On Wed, Aug 23, 2023 at 3:38 PM shveta malik wrote: > > > > > I have reviewed the v12-0002 patch and I have some comments. I see the > > latest version posted sometime back and if

Re: Synchronizing slots from primary to standby

2023-08-25 Thread Alvaro Herrera
Wait a minute ... >From bac0fbef8b203c530e5117b0b7cfee13cfab78b9 Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Sat, 22 Jul 2023 10:17:48 + Subject: [PATCH v13 1/2] Allow logical walsenders to wait for physical standbys @@ -2498,6 +2500,13 @@ ReorderBufferProcessTXN(ReorderBuffer

Re: Synchronizing slots from primary to standby

2023-08-24 Thread shveta malik
On Wed, Aug 23, 2023 at 4:21 PM Dilip Kumar wrote: > > On Wed, Aug 23, 2023 at 3:38 PM shveta malik wrote: > > > I have reviewed the v12-0002 patch and I have some comments. I see the > latest version posted sometime back and if any of this comment is > already fixed in this version then feel

Re: Synchronizing slots from primary to standby

2023-08-23 Thread Dilip Kumar
On Wed, Aug 23, 2023 at 3:38 PM shveta malik wrote: > I have reviewed the v12-0002 patch and I have some comments. I see the latest version posted sometime back and if any of this comment is already fixed in this version then feel free to ignore that. In general, code still needs a lot more

Re: Synchronizing slots from primary to standby

2023-08-23 Thread shveta malik
On Thu, Aug 17, 2023 at 4:09 PM shveta malik wrote: > > On Thu, Aug 17, 2023 at 11:55 AM shveta malik wrote: > > > > On Thu, Aug 17, 2023 at 11:44 AM Drouvot, Bertrand > > wrote: > > > > > > Hi, > > > > > > On 8/14/23 11:52 AM, shveta malik wrote: > > > > > > > > > > > We (myself and Ajin)

Re: Synchronizing slots from primary to standby

2023-08-22 Thread shveta malik
On Thu, Aug 17, 2023 at 11:55 AM shveta malik wrote: > > On Thu, Aug 17, 2023 at 11:44 AM Drouvot, Bertrand > wrote: > > > > Hi, > > > > On 8/14/23 11:52 AM, shveta malik wrote: > > > > > > > > We (myself and Ajin) performed the tests to compute the lag in standby > > > slots as compared to

Re: Synchronizing slots from primary to standby

2023-08-17 Thread shveta malik
On Thu, Aug 17, 2023 at 11:55 AM shveta malik wrote: > > On Thu, Aug 17, 2023 at 11:44 AM Drouvot, Bertrand > wrote: > > > > Hi, > > > > On 8/14/23 11:52 AM, shveta malik wrote: > > > > > > > > We (myself and Ajin) performed the tests to compute the lag in standby > > > slots as compared to

Re: Synchronizing slots from primary to standby

2023-08-17 Thread shveta malik
On Thu, Aug 17, 2023 at 11:44 AM Drouvot, Bertrand wrote: > > Hi, > > On 8/14/23 11:52 AM, shveta malik wrote: > > > > > We (myself and Ajin) performed the tests to compute the lag in standby > > slots as compared to primary slots with different number of slot-sync > > workers configured. > > > >

Re: Synchronizing slots from primary to standby

2023-08-17 Thread Drouvot, Bertrand
Hi, On 8/14/23 11:52 AM, shveta malik wrote: We (myself and Ajin) performed the tests to compute the lag in standby slots as compared to primary slots with different number of slot-sync workers configured. Thanks! 3 DBs were created, each with 30 tables and each table having one

Re: Synchronizing slots from primary to standby

2023-08-15 Thread Ajin Cherian
On Mon, Aug 14, 2023 at 8:38 PM shveta malik wrote: > > On Mon, Aug 14, 2023 at 3:22 PM shveta malik wrote: > > > > On Tue, Aug 8, 2023 at 11:11 AM Drouvot, Bertrand > > wrote: > > > > > > Hi, > > > > > > On 8/8/23 7:01 AM, shveta malik wrote: > > > > On Mon, Aug 7, 2023 at 3:17 PM Drouvot,

Re: Synchronizing slots from primary to standby

2023-08-14 Thread shveta malik
On Mon, Aug 14, 2023 at 3:22 PM shveta malik wrote: > > On Tue, Aug 8, 2023 at 11:11 AM Drouvot, Bertrand > wrote: > > > > Hi, > > > > On 8/8/23 7:01 AM, shveta malik wrote: > > > On Mon, Aug 7, 2023 at 3:17 PM Drouvot, Bertrand > > > wrote: > > >> > > >> Hi, > > >> > > >> On 8/4/23 1:32 PM,

Re: Synchronizing slots from primary to standby

2023-08-14 Thread shveta malik
On Tue, Aug 8, 2023 at 11:11 AM Drouvot, Bertrand wrote: > > Hi, > > On 8/8/23 7:01 AM, shveta malik wrote: > > On Mon, Aug 7, 2023 at 3:17 PM Drouvot, Bertrand > > wrote: > >> > >> Hi, > >> > >> On 8/4/23 1:32 PM, shveta malik wrote: > >>> On Fri, Aug 4, 2023 at 2:44 PM Drouvot, Bertrand > >>>

Re: Synchronizing slots from primary to standby

2023-08-07 Thread Drouvot, Bertrand
Hi, On 8/8/23 7:01 AM, shveta malik wrote: On Mon, Aug 7, 2023 at 3:17 PM Drouvot, Bertrand wrote: Hi, On 8/4/23 1:32 PM, shveta malik wrote: On Fri, Aug 4, 2023 at 2:44 PM Drouvot, Bertrand wrote: On 7/28/23 4:39 PM, Bharath Rupireddy wrote: Agreed. That is why in v10,v11 patches,

Re: Synchronizing slots from primary to standby

2023-08-07 Thread shveta malik
On Mon, Aug 7, 2023 at 3:17 PM Drouvot, Bertrand wrote: > > Hi, > > On 8/4/23 1:32 PM, shveta malik wrote: > > On Fri, Aug 4, 2023 at 2:44 PM Drouvot, Bertrand > > wrote: > >> On 7/28/23 4:39 PM, Bharath Rupireddy wrote: > > >> Sorry to be late, but I gave a second thought and I wonder if we

Re: Synchronizing slots from primary to standby

2023-08-07 Thread shveta malik
On Tue, Aug 1, 2023 at 4:52 PM shveta malik wrote: > > On Thu, Jul 27, 2023 at 12:13 PM shveta malik wrote: > > > > On Thu, Jul 27, 2023 at 10:55 AM Amit Kapila > > wrote: > > > > > > On Wed, Jul 26, 2023 at 10:31 AM shveta malik > > > wrote: > > > > > > > > On Mon, Jul 24, 2023 at 9:00 AM

Re: Synchronizing slots from primary to standby

2023-08-07 Thread Drouvot, Bertrand
Hi, On 8/4/23 1:32 PM, shveta malik wrote: On Fri, Aug 4, 2023 at 2:44 PM Drouvot, Bertrand wrote: On 7/28/23 4:39 PM, Bharath Rupireddy wrote: Sorry to be late, but I gave a second thought and I wonder if we really need this design. (i.e start a logical replication background worker on

Re: Synchronizing slots from primary to standby

2023-08-04 Thread shveta malik
On Fri, Aug 4, 2023 at 2:44 PM Drouvot, Bertrand wrote: > > Hi, > > On 7/28/23 4:39 PM, Bharath Rupireddy wrote: > > On Mon, Jul 24, 2023 at 9:00 AM Amit Kapila wrote: > >> > >>> 2. All candidate standbys will start one slot sync worker per logical > >>> slot which might not be scalable. > >> >

Re: Synchronizing slots from primary to standby

2023-08-04 Thread Drouvot, Bertrand
Hi, On 7/28/23 4:39 PM, Bharath Rupireddy wrote: On Mon, Jul 24, 2023 at 9:00 AM Amit Kapila wrote: 2. All candidate standbys will start one slot sync worker per logical slot which might not be scalable. Yeah, that doesn't sound like a good idea but IIRC, the proposed patch is using one

Re: Synchronizing slots from primary to standby

2023-08-04 Thread Drouvot, Bertrand
Hi, On 7/24/23 4:32 AM, Bharath Rupireddy wrote: On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: Here are my thoughts about this feature: Thanks for looking at it! Important considerations: 1. Does this design guarantee the row versions required by subscribers aren't removed on

Re: Synchronizing slots from primary to standby

2023-08-03 Thread shveta malik
On Thu, Aug 3, 2023 at 12:28 AM Bharath Rupireddy wrote: > > On Tue, Aug 1, 2023 at 5:01 PM shveta malik wrote: > > > > > The work division amongst the sync workers can > > > be simple, the logical replication launcher builds a shared memory > > > structure based on number of slots to sync and

Re: Synchronizing slots from primary to standby

2023-08-02 Thread Bharath Rupireddy
On Tue, Aug 1, 2023 at 5:01 PM shveta malik wrote: > > > The work division amongst the sync workers can > > be simple, the logical replication launcher builds a shared memory > > structure based on number of slots to sync and starts the sync workers > > dynamically, and each sync worker picks

Re: Synchronizing slots from primary to standby

2023-08-01 Thread shveta malik
On Fri, Jul 28, 2023 at 8:54 PM Bharath Rupireddy wrote: > > On Thu, Jul 27, 2023 at 10:55 AM Amit Kapila wrote: > > > > I wonder if we anyway some sort of design like this because we > > shouldn't allow to spawn as many workers as the number of databases. > > There has to be some existing or

Re: Synchronizing slots from primary to standby

2023-07-28 Thread Bharath Rupireddy
On Thu, Jul 27, 2023 at 10:55 AM Amit Kapila wrote: > > I wonder if we anyway some sort of design like this because we > shouldn't allow to spawn as many workers as the number of databases. > There has to be some existing or new GUC like max_sync_slot_workers > which decided the number of

Re: Synchronizing slots from primary to standby

2023-07-28 Thread Bharath Rupireddy
On Mon, Jul 24, 2023 at 9:00 AM Amit Kapila wrote: > > > 2. All candidate standbys will start one slot sync worker per logical > > slot which might not be scalable. > > Yeah, that doesn't sound like a good idea but IIRC, the proposed patch > is using one worker per database (for all slots

Re: Synchronizing slots from primary to standby

2023-07-27 Thread Amit Kapila
On Wed, Jul 26, 2023 at 5:55 PM shveta malik wrote: > > On Mon, Jul 24, 2023 at 8:03 AM Bharath Rupireddy > wrote: > > > > On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: > > > > > > Thanks Bharat for letting us know. It is okay to split the patch, it > > > may definitely help to understand

Re: Synchronizing slots from primary to standby

2023-07-27 Thread shveta malik
On Thu, Jul 27, 2023 at 10:55 AM Amit Kapila wrote: > > On Wed, Jul 26, 2023 at 10:31 AM shveta malik wrote: > > > > On Mon, Jul 24, 2023 at 9:00 AM Amit Kapila wrote: > > > > > > On Mon, Jul 24, 2023 at 8:03 AM Bharath Rupireddy > > > wrote: > > > > > > > > Is having one (or a few more - not

Re: Synchronizing slots from primary to standby

2023-07-26 Thread Amit Kapila
On Wed, Jul 26, 2023 at 10:31 AM shveta malik wrote: > > On Mon, Jul 24, 2023 at 9:00 AM Amit Kapila wrote: > > > > On Mon, Jul 24, 2023 at 8:03 AM Bharath Rupireddy > > wrote: > > > > > > Is having one (or a few more - not > > > necessarily one for each logical slot) worker for all logical

Re: Synchronizing slots from primary to standby

2023-07-26 Thread shveta malik
On Mon, Jul 24, 2023 at 8:03 AM Bharath Rupireddy wrote: > > On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: > > > > Thanks Bharat for letting us know. It is okay to split the patch, it > > may definitely help to understand the modules better but shall we take > > a step back and try to

Re: Synchronizing slots from primary to standby

2023-07-25 Thread shveta malik
On Mon, Jul 24, 2023 at 9:00 AM Amit Kapila wrote: > > On Mon, Jul 24, 2023 at 8:03 AM Bharath Rupireddy > wrote: > > > > On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: > > > > > > Thanks Bharat for letting us know. It is okay to split the patch, it > > > may definitely help to understand

Re: Synchronizing slots from primary to standby

2023-07-23 Thread Amit Kapila
On Mon, Jul 24, 2023 at 8:03 AM Bharath Rupireddy wrote: > > On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: > > > > Thanks Bharat for letting us know. It is okay to split the patch, it > > may definitely help to understand the modules better but shall we take > > a step back and try to

Re: Synchronizing slots from primary to standby

2023-07-23 Thread Bharath Rupireddy
On Fri, Jul 21, 2023 at 5:16 PM shveta malik wrote: > > Thanks Bharat for letting us know. It is okay to split the patch, it > may definitely help to understand the modules better but shall we take > a step back and try to reevaluate the design first before moving to > other tasks? Agree that

Re: Synchronizing slots from primary to standby

2023-07-21 Thread shveta malik
On Fri, Jul 21, 2023 at 11:36 AM Bharath Rupireddy wrote: > > On Thu, Jul 20, 2023 at 5:05 PM shveta malik wrote: > > > > On Fri, Jun 16, 2023 at 3:26 PM Amit Kapila wrote: > > > > > > On Mon, Apr 17, 2023 at 7:37 PM Drouvot, Bertrand > > > wrote: > > > > > > > > > 3. As mentioned in the

Re: Synchronizing slots from primary to standby

2023-07-21 Thread Bharath Rupireddy
On Thu, Jul 20, 2023 at 5:05 PM shveta malik wrote: > > On Fri, Jun 16, 2023 at 3:26 PM Amit Kapila wrote: > > > > On Mon, Apr 17, 2023 at 7:37 PM Drouvot, Bertrand > > wrote: > > > > > > 3. As mentioned in the initial email, I think it would be better to > > replace LIST_SLOTS command with a

Re: Synchronizing slots from primary to standby

2023-07-20 Thread shveta malik
On Fri, Jun 16, 2023 at 3:26 PM Amit Kapila wrote: > > On Mon, Apr 17, 2023 at 7:37 PM Drouvot, Bertrand > wrote: > > > 3. As mentioned in the initial email, I think it would be better to > replace LIST_SLOTS command with a SELECT query. > I had a look at this thread. I am interested to work

Re: Synchronizing slots from primary to standby

2023-07-12 Thread Peter Eisentraut
On 14.04.23 15:22, Drouvot, Bertrand wrote: Now that the "Minimal logical decoding on standby" patch series (mentioned up-thread) has been committed, I think we can resume working on this one ("Synchronizing slots from primary to standby"). Maybe you have seen this extension that was released

Re: Synchronizing slots from primary to standby

2023-07-09 Thread Amit Kapila
On Sun, Jul 9, 2023 at 1:01 PM Bharath Rupireddy wrote: > > On Fri, Jun 16, 2023 at 3:26 PM Amit Kapila wrote: > > > > > > 1. Can you please try to explain the functionality of the overall > > patch somewhere in the form of comments and or commit message? > > IIUC, there are 2 core ideas of the

Re: Synchronizing slots from primary to standby

2023-07-09 Thread Bharath Rupireddy
On Fri, Jun 16, 2023 at 3:26 PM Amit Kapila wrote: > > On Mon, Apr 17, 2023 at 7:37 PM Drouvot, Bertrand > wrote: > > > > Please find attached V5 (a rebase of V4 posted up-thread). > > > > In addition to the "rebasing" work, the TAP test adds a test about conflict > > handling (logical slot

Re: Synchronizing slots from primary to standby

2023-06-30 Thread Amit Kapila
On Thu, Jun 29, 2023 at 3:52 PM Hayato Kuroda (Fujitsu) wrote: > > 2. I want to confirm the reason why new replication command is added. > Are you referring LIST_SLOTS command? If so, I don't think that is required and instead, we can use a query to fetch the required information. > IIUC the >

Re: Synchronizing slots from primary to standby

2023-06-30 Thread Drouvot, Bertrand
Hi Kuroda-san, On 6/29/23 12:22 PM, Hayato Kuroda (Fujitsu) wrote: Dear Drouvot, Hi, I'm also interested in the feature. Followings are my high-level comments. I did not mention some detailed notations because this patch is not at the stage. And very sorry that I could not follow all of this

Re: Synchronizing slots from primary to standby

2023-06-29 Thread Drouvot, Bertrand
Hi, On 6/29/23 12:36 PM, Amit Kapila wrote: On Wed, Jun 28, 2023 at 12:19 PM Drouvot, Bertrand wrote: Yeah, I think once the slot is dropped we just have to wait for the slot to be re-created on the standby according to the new synchronize_slot_names GUC. Assuming the initial slot "creation"

Re: Synchronizing slots from primary to standby

2023-06-29 Thread Amit Kapila
On Thu, Jun 29, 2023 at 3:52 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Drouvot, > > Hi, I'm also interested in the feature. Followings are my high-level comments. > I did not mention some detailed notations because this patch is not at the > stage. > And very sorry that I could not follow all

Re: Synchronizing slots from primary to standby

2023-06-29 Thread Amit Kapila
On Wed, Jun 28, 2023 at 12:19 PM Drouvot, Bertrand wrote: > > On 6/26/23 12:34 PM, Amit Kapila wrote: > > On Mon, Jun 26, 2023 at 11:15 AM Drouvot, Bertrand > > wrote: > >> > >> On 6/20/23 12:22 PM, Amit Kapila wrote: > >>> On Mon, Jun 19, 2023 at 9:56 PM Drouvot, Bertrand > >>> wrote: > >> >

RE: Synchronizing slots from primary to standby

2023-06-29 Thread Hayato Kuroda (Fujitsu)
Dear Drouvot, Hi, I'm also interested in the feature. Followings are my high-level comments. I did not mention some detailed notations because this patch is not at the stage. And very sorry that I could not follow all of this discussions. 1. I thought that we should not reuse logical

Re: Synchronizing slots from primary to standby

2023-06-28 Thread Drouvot, Bertrand
Hi, On 6/26/23 12:34 PM, Amit Kapila wrote: On Mon, Jun 26, 2023 at 11:15 AM Drouvot, Bertrand wrote: On 6/20/23 12:22 PM, Amit Kapila wrote: On Mon, Jun 19, 2023 at 9:56 PM Drouvot, Bertrand wrote: In such a case (slot valid on the primary but invalidated on the standby) then I think

Re: Synchronizing slots from primary to standby

2023-06-26 Thread Amit Kapila
On Mon, Jun 26, 2023 at 11:15 AM Drouvot, Bertrand wrote: > > On 6/20/23 12:22 PM, Amit Kapila wrote: > > On Mon, Jun 19, 2023 at 9:56 PM Drouvot, Bertrand > > wrote: > > >> In such a case (slot valid on the primary but invalidated on the standby) > >> then I think we > >> could drop and

Re: Synchronizing slots from primary to standby

2023-06-25 Thread Drouvot, Bertrand
Hi, On 6/20/23 12:22 PM, Amit Kapila wrote: On Mon, Jun 19, 2023 at 9:56 PM Drouvot, Bertrand wrote: In such a case (slot valid on the primary but invalidated on the standby) then I think we could drop and recreate the invalidated slot on the standby. Will it be safe? Because after

Re: Synchronizing slots from primary to standby

2023-06-20 Thread Amit Kapila
On Mon, Jun 19, 2023 at 9:56 PM Drouvot, Bertrand wrote: > > On 6/19/23 12:03 PM, Amit Kapila wrote: > > On Mon, Jun 19, 2023 at 11:34 AM Drouvot, Bertrand > > wrote: > >> > >> Also I think we need to handle the case of invalidated replication > >> slot(s): should > >> we drop/recreate it/them?

Re: Synchronizing slots from primary to standby

2023-06-19 Thread Drouvot, Bertrand
Hi, On 6/19/23 12:03 PM, Amit Kapila wrote: On Mon, Jun 19, 2023 at 11:34 AM Drouvot, Bertrand wrote: Also I think we need to handle the case of invalidated replication slot(s): should we drop/recreate it/them? (as the main goal is to have sync slot(s) on the standby). Do you intend to

Re: Synchronizing slots from primary to standby

2023-06-19 Thread Amit Kapila
On Mon, Jun 19, 2023 at 11:34 AM Drouvot, Bertrand wrote: > > Also I think we need to handle the case of invalidated replication slot(s): > should > we drop/recreate it/them? (as the main goal is to have sync slot(s) on the > standby). > Do you intend to ask what happens to logical slots

<    3   4   5   6   7   8   9   >