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