Re: shmem startup and shutdown hooks - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: shmem startup and shutdown hooks
Date
Msg-id 20130527051550.GR15045@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: shmem startup and shutdown hooks  (Amit kapila <amit.kapila@huawei.com>)
List pgsql-hackers
Amit kapila wrote:
> 
> On Saturday, May 25, 2013 12:50 AM Alvaro Herrera wrote:

> > It seems that the right place to do this is checkpointer shutdown, i.e.
> > when checkpointer is told to close shop it should also invoke various
> > modules' shutdown callbacks.  There's no hook point there though, so
> > we'd need to introduce something new for this specific purpose.
> 
> Do you mean to say that during shutdown of checkpoint, it should call
> interface which does same as shmem_exit() which means call shutdown
> callbacks of other modules?

I mean we should have some other hooking point for modules, one which is
guaranteed to be called only during shutdown.  The current hook point in
use is shared memory reset, which does happen during shutdown; but also
happens when a process crashes and postmaster reinits the whole thing.

> Why would checkpointer shutdown is better place to handle?

Because it's the process whose termination defines when a system
shutdown takes place.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Planning incompatibilities for Postgres 10.0
Next
From: Gurjeet Singh
Date:
Subject: Re: Processing long AND/OR lists