Re: Improving the latch handling between logical replication launcher and worker processes.

2024-07-10 Thread vignesh C
On Mon, 8 Jul 2024 at 17:46, vignesh C wrote: > > On Fri, 5 Jul 2024 at 18:38, Heikki Linnakangas wrote: > > > > On 05/07/2024 14:07, vignesh C wrote: > > > On Thu, 4 Jul 2024 at 16:52, Heikki Linnakangas wrote: > > >> > > >> I'm don't quite understand the problem we're trying to fix: > > >> >

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-07-08 Thread Amit Kapila
On Mon, Jul 8, 2024 at 5:47 PM vignesh C wrote: > > On Fri, 5 Jul 2024 at 18:38, Heikki Linnakangas wrote: > > > > > As an alternative, smaller fix, I think we could do the attached. It > > forces the launcher's main loop to do another iteration, if it calls > > logicalrep_worker_launch(). That

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-07-08 Thread vignesh C
On Fri, 5 Jul 2024 at 18:38, Heikki Linnakangas wrote: > > On 05/07/2024 14:07, vignesh C wrote: > > On Thu, 4 Jul 2024 at 16:52, Heikki Linnakangas wrote: > >> > >> I'm don't quite understand the problem we're trying to fix: > >> > >>> Currently the launcher's latch is used for the following:

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-07-08 Thread Amit Kapila
On Fri, Jul 5, 2024 at 6:38 PM Heikki Linnakangas wrote: > > > Your solution with an additional latch seems better because it makes > WaitForReplicationWorkerAttach() react more quickly, without the 10 s > wait. I'm surprised we have that in the first place, 10 s seems like a > pretty long time

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-07-05 Thread Heikki Linnakangas
On 05/07/2024 14:07, vignesh C wrote: On Thu, 4 Jul 2024 at 16:52, Heikki Linnakangas wrote: I'm don't quite understand the problem we're trying to fix: Currently the launcher's latch is used for the following: a) worker process attach b) worker process exit and c) subscription creation.

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-07-05 Thread vignesh C
On Thu, 4 Jul 2024 at 16:52, Heikki Linnakangas wrote: > > I'm don't quite understand the problem we're trying to fix: > > > Currently the launcher's latch is used for the following: a) worker > > process attach b) worker process exit and c) subscription creation. > > Since this same latch is

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-07-04 Thread Heikki Linnakangas
I'm don't quite understand the problem we're trying to fix: Currently the launcher's latch is used for the following: a) worker process attach b) worker process exit and c) subscription creation. Since this same latch is used for multiple cases, the launcher process is not able to handle

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-05-30 Thread vignesh C
On Thu, 30 May 2024 at 08:46, Peter Smith wrote: > > On Wed, May 29, 2024 at 7:53 PM vignesh C wrote: > > > > On Wed, 29 May 2024 at 10:41, Peter Smith wrote: > > > > > > On Thu, Apr 25, 2024 at 6:59 PM vignesh C wrote: > > > > > > > > > > > c) Don't reset the latch at worker attach and allow

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-05-29 Thread Peter Smith
On Wed, May 29, 2024 at 7:53 PM vignesh C wrote: > > On Wed, 29 May 2024 at 10:41, Peter Smith wrote: > > > > On Thu, Apr 25, 2024 at 6:59 PM vignesh C wrote: > > > > > > > > c) Don't reset the latch at worker attach and allow launcher main to > > > identify and handle it. For this there is a

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-05-29 Thread vignesh C
On Wed, 29 May 2024 at 10:41, Peter Smith wrote: > > On Thu, Apr 25, 2024 at 6:59 PM vignesh C wrote: > > > > > c) Don't reset the latch at worker attach and allow launcher main to > > identify and handle it. For this there is a patch v6-0002 available at > > [2]. > > This option c seems the

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-05-29 Thread vignesh C
On Fri, 10 May 2024 at 07:39, Hayato Kuroda (Fujitsu) wrote: > > Dear Vignesh, > > Thanks for raising idea! > > > a) Introduce a new latch to handle worker attach and exit. > > Just to confirm - there are three wait events for launchers, so I feel we may > be > able to create latches per wait

Re: Improving the latch handling between logical replication launcher and worker processes.

2024-05-28 Thread Peter Smith
On Thu, Apr 25, 2024 at 6:59 PM vignesh C wrote: > ... > a) Introduce a new latch to handle worker attach and exit. IIUC there is normally only the “shared” latch or a “process local” latch. i.e. AFAICT is is quite uncommon to invent a new latches like option a is proposing. I did not see any

RE: Improving the latch handling between logical replication launcher and worker processes.

2024-05-09 Thread Hayato Kuroda (Fujitsu)
Dear Vignesh, Thanks for raising idea! > a) Introduce a new latch to handle worker attach and exit. Just to confirm - there are three wait events for launchers, so I feel we may be able to create latches per wait event. Is there a reason to introduce "a" latch? > b) Add a new GUC

RE: Improving the latch handling between logical replication launcher and worker processes.

2024-04-26 Thread Zhijie Hou (Fujitsu)
On Thursday, April 25, 2024 4:59 PM vignesh C wrote: > > Hi, > > Currently the launcher's latch is used for the following: a) worker process > attach > b) worker process exit and c) subscription creation. > Since this same latch is used for multiple cases, the launcher process is not > able >

Improving the latch handling between logical replication launcher and worker processes.

2024-04-25 Thread vignesh C
Hi, Currently the launcher's latch is used for the following: a) worker process attach b) worker process exit and c) subscription creation. Since this same latch is used for multiple cases, the launcher process is not able to handle concurrent scenarios like: a) Launcher started a new apply