Re: Linux LSB init script

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org, Wolfgang Wilhelm <wolfgang20121964(at)yahoo(dot)de>
Subject: Re: Linux LSB init script
Date: 2009-09-17 18:21:37
Message-ID: alpine.GSO.2.01.0909171408380.17959@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 17 Sep 2009, Peter Eisentraut wrote:

> On ons, 2009-09-16 at 12:05 -0500, Kevin Grittner wrote:
>> Well, with differences in behavior, of course, like attempting a fast
>> shutdown, and escalating to an immediate shutdown if that doesn't
>> succeed in the allowed time.
>
> Right, but if you think that this behavior the right/better one (which
> it arguably isn't), why shouldn't it be available from the mainline
> tools? Obviously, most people have felt for the last N years that
> pg_ctl provides adequate shutdown options.

I've implemented exactly the same logic Kevin describes for a past
consulting customer and for multiple forms of shutdown scripts at Truviso.
I would suggest the situation here is that it's so easy to script a custom
solution that the other people who have done the same don't have any
motivation to get that fixed upstream, which would take a bunch of arguing
on this list to accomplish. Easier to just work around it and move on.

You're correct that pg_ctl provides "adequate" options here in the respect
that it's possible to build the behavior many people want from the
primitives available. I'm with Kevin that what many people would like to
see in a system shutdown script is not possible using pg_ctl alone. Fast
shutdown, timeout, then immediate shutdown is absolutely the best default
behavior if the server must go down, but you can afford to wait a bit to
try and do that more cleanly than going straight to immediate.

To answer the next question, "why doesn't fast shutdown work for you?",
see http://archives.postgresql.org/pgsql-bugs/2009-03/msg00062.php

If that were fixed maybe fast shutdown would be more useful, as it is I
have to assume it will fail because open COPYs are pretty common for our
apps. But I don't want to go straight to immediate for the sake of other
programs that can shut themselves down more cleanly if the server goes
through the fast shutdown stage first.

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stef Walter 2009-09-17 18:30:27 Re: pg_hba.conf: samehost and samenet
Previous Message Magnus Hagander 2009-09-17 18:15:35 Re: LDAP where DN does not include UID attribute