Re: (Never?) Kill Postmaster? - Mailing list pgsql-general

From Tom Lane
Subject Re: (Never?) Kill Postmaster?
Date
Msg-id 29385.1193227273@sss.pgh.pa.us
Whole thread Raw
In response to Re: (Never?) Kill Postmaster?  ("Michael Harris" <michael.harris@ericsson.com>)
Responses Re: (Never?) Kill Postmaster?  (Christian Schröder <cs@deriva.de>)
List pgsql-general
"Michael Harris" <michael.harris@ericsson.com> writes:
> The tip is ''kill -9' the postmaster', which has two important
> differences to the scenario I just described:
> 1) kill -9 means the OS kills the process without allowing it to clean
> up after itself
> 2) The postmaster is the master postgresql backend process. If you want
> to kill a single query you would not want to kill that.

Right: the tip is to not kill -9 the parent process; it's not saying
anything about child server processes.

If you've got a child process that's unresponsive to SIGINT then you
can send it a SIGKILL instead; the downside is that this will force a
restart of the other children too, that is you're interrupting all
database sessions not only the one.  But Postgres will recover
automatically and I don't think I've ever heard of anyone getting data
corruption as a result of such a thing.

SIGKILL on the parent is an entirely different thing.  You'll have to
manually restart Postgres, possibly do some manual cleanup, and there's
a small but nonzero chance of ensuing data corruption ... especially if
you fat-finger any of the manual steps.  Plus there simply isn't any
good reason to do it.  The postmaster should always respond to more
gentle shutdown signals, because it doesn't run any user-provided
commands that could send it off into the weeds.

Hence the TIP.

            regards, tom lane

pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: deadlock detected, only selects (not select-for-update)
Next
From: João Paulo Zavanela
Date:
Subject: Install plJava