Re: Replication slot drop message is sent after pgstats shutdown. - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Replication slot drop message is sent after pgstats shutdown.
Date
Msg-id CAD21AoDUVTEdTJ_0WMbiRdJbKqqRgOio0en43M1aKQckqM105A@mail.gmail.com
Whole thread Raw
In response to Re: Replication slot drop message is sent after pgstats shutdown.  (Andres Freund <andres@anarazel.de>)
Responses Re: Replication slot drop message is sent after pgstats shutdown.
List pgsql-hackers
On Wed, Sep 1, 2021 at 2:39 AM Andres Freund <andres@anarazel.de> wrote:
>
> Hi,
>
> On 2021-08-31 18:34:12 +0900, Kyotaro Horiguchi wrote:
> > At Tue, 31 Aug 2021 17:14:45 +0900, Masahiko Sawada <sawada.mshk@gmail.com> wrote in
> > > On Tue, Aug 31, 2021 at 2:34 PM Andres Freund <andres@anarazel.de> wrote:
> > > >
> > > > On 2021-08-31 14:22:39 +0900, Masahiko Sawada wrote:
> > > > > You mean to move only the part of sending the message to its own
> > > > > before_shmem_exit() callback? or move ReplicationSlotRelease() and
> > > > > ReplicationSlotCleanup() from ProcKill() to it?
> > > >
> > > > The latter.
> > >
> > > Makes sense.
> > >
> > > I've attached the patch that moves them to its own
> > > before_shmem_exit(). Unless I missed to register the callback it works
> > > the same as before except for where to release and clean up the slots.
> >
> > Is there any reason we need to register the callback dynamically?  It
> > seems to me what we need to do here is to call the functions at
> > before-shmem-exit.
>
> +1. I'd just add a ReplicationSlotInitialize() to BaseInit().

+1. But BaseInit() is also called by auxiliary processes, which seems
not necessary. So isn't it better to add it to InitPostgres() or
InitProcess()?

Regards,

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: "alvherre@alvh.no-ip.org"
Date:
Subject: Re: archive status ".ready" files may be created too early
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Added schema level support for publication.