Comment 8 for bug 154012

Revision history for this message
Decibel (decibel) wrote : Re: [Bug 154012] Re: pg_ctlcluster uses stop immediate on it's own

On Mon, Nov 12, 2007 at 04:03:48PM -0000, Martin Pitt wrote:
> Hi,
>
> Decibel [2007-11-12 15:29 -0000]:
> > >> So --force would do an immediate shutdown then?
> > >
> > > No, in the current implementation it uses 'fast', and only if that
> > > fails, uses 'immediate'.
> >
> > I don't see what that buys us.
>
> Maybe there is a misunderstanding: pg_ctlcluster uses "smart" by
> default now, so if you call it directly, or call the init script with
> 'restart', then "smart" is used. fast/immediate is only used in the
> init script, thus usually when you shutdown the machine. In that case
> it is preferable *not* to wait for clients, otherwise you stall the
> reboot/shutdown.

No, I understand. But unless the init scripts will absolutely hang a
shutdown if they don't exit then there's no reason to fall through to
immediate. immediate == kill -9, which is what init will do anyway as it
dies.

The problem is that using fast is a completely valid use-case outside of
init, and in that case it's a really bad idea to automatically fall
through to immediate. If fast doesn't work we should leave things as-is
so the admin can investigate. If you want to be admin-friendly, have the
script print out an appropriate sudo command that can be cut and pasted.
--
Decibel!, aka Jim C. Nasby, Database Architect <email address hidden>
Give your computer some brain candy! www.distributed.net Team #1828