RE: [PATCH] Reuse Workers and Replication Slots during Logical Replication - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: [PATCH] Reuse Workers and Replication Slots during Logical Replication
Date
Msg-id TYAPR01MB586659C7EAE9A27553512B54F524A@TYAPR01MB5866.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
List pgsql-hackers
Dear Amit,

> > > This actually makes sense. I quickly try to do that without adding any
> > > new replication message. As you would expect, it did not work.
> > > I don't really know what's needed to make a connection to last for
> > > more than one iteration. Need to look into this. Happy to hear any
> > > suggestions and thoughts.
> >
> 
> It is not clear to me what exactly you tried here which didn't work.
> Can you please explain a bit more?

Just to confirm, this is not my part. Melih can answer this...

> > I have analyzed how we handle this. Please see attached the patch (0003) which
> > allows reusing connection.
> >
> 
> Why did you change the application name during the connection?

It was because the lifetime of tablesync worker is longer than slots's one and
tablesync worker creates temporary replication slots many times, per the target
relation. The name of each slots has relid, so I thought that it was not suitable.
But in the later patch the tablesync worker tries to reuse the slot during the
synchronization, so in this case the application_name should be same as slotname.

I added comment in 0003, and new file 0006 file to use slot name as application_name
again. Note again that the separation was just for specifying changes, Melih can
include them to one part of files if needed.


Best Regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: Do we want a hashset type?
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: Synchronizing slots from primary to standby