Re: [PATCH] ProcessInterrupts_hook - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [PATCH] ProcessInterrupts_hook
Date
Msg-id CA+Tgmoa8k8+M86v-ZVsQ2xVNSnxU72uM3-Kv=attvOH8nUvJ0g@mail.gmail.com
Whole thread Raw
In response to [PATCH] ProcessInterrupts_hook  (Craig Ringer <craig.ringer@enterprisedb.com>)
Responses Re: [PATCH] ProcessInterrupts_hook  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Jan 18, 2021 at 3:00 AM Craig Ringer
<craig.ringer@enterprisedb.com> wrote:
> A few times lately I've been doing things in extensions that've made me want to be able to run my own code whenever
InterruptPendingis true and CHECK_FOR_INTERRUPTS() calls ProcessInterrupts() 

I've wanted this in the past, too, so +1 from me.

> What I really want to go along with this is a way for any backend to observe the postmaster's pmState and its
"Shutdown"variable's value, so any backend can tell if we're in FastShutdown, SmartShutdown, etc. Copies in shmem only
obviously.But I'm not convinced it's right to just copy these vars as-is to shmem, and I don't want to use the memory
fora ProcSignal slot for something that won't be relevant for most backends for most of the postmaster lifetime. Ideas
welcomed.

I've wanted something along this line, too, but what I was thinking
about was more along the lines of having the postmaster signal the
backends when a smart shutdown happened. After all when a fast
shutdown happens the backends already get told to terminate, and that
seems like it ought to be enough: I'm not sure backends have any
business caring about why they are being asked to terminate. But they
might well want to know whether a smart shutdown is in progress, and
right now there's no way for them to know that.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Added schema level support for publication.
Next
From: Robert Haas
Date:
Subject: Re: recovering from "found xmin ... from before relfrozenxid ..."