Re: pg_terminate_backend() idea

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_terminate_backend() idea
Date: 2008-04-15 23:08:01
Message-ID: 87r6d6somm.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

"Bruce Momjian" <bruce(at)momjian(dot)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's PostgreSQL training!

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2008-04-15 23:30:22 Re: pg_terminate_backend() issues
Previous Message Tom Lane 2008-04-15 21:55:36 Re: pg_terminate_backend() issues

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-04-15 23:30:22 Re: pg_terminate_backend() issues
Previous Message Tom Lane 2008-04-15 23:03:11 DROP DATABASE vs patch to not remove files right away