Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)

From: Daniel Farina <daniel(at)heroku(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)
Date: 2012-03-26 23:09:42
Message-ID: CAAZKuFZP+ss9QFzka2uZb9eoThoc0Rp_JvjjL185PTYFFngNXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 26, 2012 at 1:57 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I'm not.  I still wouldn't trust SIGTERMing an individual backend in a
> production database.  It'll probably work, but what if it doesn't?
> Best-case scenario is you'll need to do a panic shutdown to clear the
> stuck lock or whatever that the backend left behind.  (Once you've
> diagnosed the problem, that is.)  Now, in a case where the alternative
> is a database shutdown anyway, you might as well try it.  But it's the
> kind of tool you only want to hand to responsible adults, which is why
> it's superuser-only at the moment.  I'm not sure we should be
> encouraging people to fire that weapon indiscriminately.

Okay, it was my precise intention to hand this to users so that not
only could they cancel their queries, but also force the transaction
to be aborted and the connection to be closed in case there is a
client run amok. Is there a good injection site -- perhaps
immediately after query cancellation -- where we can put in a
rollback-and-disconnect behavior?

Given this information, my understanding is that even the superuser is
coerced into undertaking an action that is unnecessarily dangerous if
they think the backend would respond to cancellation, but they also
wish to close the connection.

--
fdr

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-03-26 23:39:30 Re: 9.2 commitfest closure (was Command Triggers, v16)
Previous Message Thom Brown 2012-03-26 22:24:51 9.2 commitfest closure (was "Command Triggers, v16")