Re: pg_terminate_backend() idea - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: pg_terminate_backend() idea
Date
Msg-id 87r6d6somm.fsf@oxford.xeocode.com
Whole thread Raw
In response to pg_terminate_backend() idea  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
"Bruce Momjian" <bruce@momjian.us> writes:

> Gregory Stark wrote:
>
>> It seems to me we could replace all of the above with either SIGINT or USR1
>> and have a bunch of boolean flags in MyProc. I'm not sure of the implication
>> for sinval processing of having to get a whole bunch of LWLocks though.
>
> Keep in mind PGPROC->terminate was easier because once it was set it was
> never cleared.  If you need to clear the flag and keep going the code is
> going to need to be a little more sophisticated to avoid lost interrupts.

That's kind of the point. I don't think we care about lost interrupts for any
of these things. As long as we know a sinval flush happened I think we don't
care how many more happened. Or a cancel request or terminate request.

For sinval of course it would be important to clear the flags (with MyProc
locked) prior to processing the queue in case one arrives as soon as we're
finished. But I think that's the only detail.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about
EnterpriseDB'sPostgreSQL training!
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: DROP DATABASE vs patch to not remove files right away
Next
From: Bruce Momjian
Date:
Subject: Re: pg_terminate_backend() issues