Re: Synchronizing slots from primary to standby

2023-10-17 Thread Drouvot, Bertrand
Hi, On 10/13/23 10:35 AM, shveta malik wrote: On Thu, Oct 12, 2023 at 9:18 AM shveta malik wrote: PFA v24 patch set which has below changes: 1) 'enable_failover' displayed in pg_replication_slots. 2) Support for 'enable_failover' in pg_create_logical_replication_slot(). It is an optional a

Re: Synchronizing slots from primary to standby

2023-10-17 Thread Peter Smith
FYI - the latest patch failed to apply. [postgres@CentOS7-x64 oss_postgres_misc]$ git apply ../patches_misc/v24-0001-Allow-logical-walsenders-to-wait-for-the-physica.patch error: patch failed: src/include/utils/guc_hooks.h:160 error: src/include/utils/guc_hooks.h: patch does not apply == Kind

Re: Synchronizing slots from primary to standby

2023-10-15 Thread Ajin Cherian
On Wed, Oct 4, 2023 at 2:23 PM Peter Smith wrote: > > Here are some review comments for v20-0002. > These comments below have been addressed in patch v24 posted by Shveta. > == > 1. GENERAL - errmsg/elog messages > > There are a a lot of minor problems and/or quirks across all the > message t

Re: Synchronizing slots from primary to standby

2023-10-11 Thread shveta malik
On Tue, Oct 10, 2023 at 12:52 PM Peter Smith wrote: > > On Mon, Oct 9, 2023 at 9:34 PM shveta malik wrote: > > > > 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

Re: Synchronizing slots from primary to standby

2023-10-11 Thread shveta malik
On Tue, Oct 10, 2023 at 12:52 PM Peter Smith wrote: > > On Mon, Oct 9, 2023 at 9:34 PM shveta malik wrote: > > > > 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

Re: Synchronizing slots from primary to standby

2023-10-10 Thread Peter Smith
On Mon, Oct 9, 2023 at 9:34 PM shveta malik wrote: > > 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 ver

Re: Synchronizing slots from primary to standby

2023-10-09 Thread shveta malik
On Mon, Oct 2, 2023 at 4:29 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Shveta, > > Thank you for updating the patch! Thanks for the feedback Kuroda-san. I have addressed most of these in v22. Please find my comments inline. > > I found another ERROR due to the slot removal. Is this a real issue?

Re: Synchronizing slots from primary to standby

2023-10-09 Thread shveta malik
On Mon, Oct 9, 2023 at 3:24 AM Peter Smith wrote: > > 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 = &Repl

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 a

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 at

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 = &ReplicationSlotCtl->replication_slots[i]; > > + > > + /* Check if it is log

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, Oct

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 = &ReplicationSlotCtl->replication_slots[i]; > > + > > + /* Check if it is log

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 = &ReplicationSlotCtl->replication_slots[i]; > + > + /* Check if it is logical synchronized slot */ > + if (s->in_use && SlotIsLogical(s) && s->da

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 v

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 defin

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 synchronize_slot_n

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 sync_

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 corr

Re: Synchronizing slots from primary to standby

2023-10-03 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-03 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 Drouvot,

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 cras

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, Bertra

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 resp

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 synchr

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 n

Re: Synchronizing slots from primary to standby

2023-10-01 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 wou

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 > >>> wrote:

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 stan

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 Rec

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. WalSndWaitForSt

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}; + S

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 (and

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 followin

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 Kur

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 whi

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 Hayato

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 ap

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: > >> Right

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 t

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 a

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 wanted

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 combinations

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 va

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 spe

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 tri

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 pri

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 G

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 phy

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 > stan

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 fo

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. P

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 fre

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 *r

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 fre

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 comme

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) perfo

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 prima

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 prima

Re: Synchronizing slots from primary to standby

2023-08-16 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-16 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 logical-p

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, Bert

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, shv

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, we

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 real

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 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 th

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 wo

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 ca

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 st

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 {dbo

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 new

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 workers.

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 correspo

Re: Synchronizing slots from primary to standby

2023-07-26 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-26 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 slot

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 reeva

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 t

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 reeva

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 des

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 initia

Re: Synchronizing slots from primary to standby

2023-07-20 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 SE

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 on

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 f

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 inva

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-29 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 d

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 of

<    3   4   5   6   7   8   9   >