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

From Amit kapila
Subject Re: shmem startup and shutdown hooks
Date
Msg-id 6C0B27F7206C9E4CA54AE035729E9C38421B25B3@szxeml558-mbs.china.huawei.com
Whole thread Raw
In response to shmem startup and shutdown hooks  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: shmem startup and shutdown hooks
List pgsql-hackers
On Saturday, May 25, 2013 12:50 AM Alvaro Herrera wrote:

> Hi,

> While going through Andres' BDR code I noticed that it has a shmem
> startup hook, which installs a on_shmem_exit() callback to write stuff
> at shutdown time.  This works fine but seems somewhat of a hazard: it is
> having postmaster do the actual write, which has to access shared memory
> while doing it.  Moreover, since the callback is installed to be called
> at shmem reset, it means that a process crash causes this code to be
> called, which seems similarly broken.

> 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?
Why would checkpointer shutdown is better place to handle?

With Regards,
Amit Kapila.


pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: PostgreSQL 9.3 beta breaks some extensions "make install"
Next
From: Simon Riggs
Date:
Subject: COPY .... (FORMAT binary) syntax doesn't work