Re: [GENERAL] Unable to get postgres running after long time no vacuum

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Leon Mergen <leon(at)solatis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Unable to get postgres running after long time no vacuum
Date: 2007-07-08 22:49:14
Message-ID: 20070708224913.GE5319@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> "Leon Mergen" <leon(at)solatis(dot)com> writes:
> > On 7/8/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> It's actually not that easy to get out of the single-user mode without
> >> it doing a checkpoint. I suppose you must have either SIGQUIT or
> >> SIGKILL'd it. While there's nothing we can do about SIGKILL, it strikes
> >> me that it might be a good safety measure if single-user mode treated
> >> SIGQUIT the same as SIGTERM, ie, non-panic shutdown. Comments anyone?
>
> > What I found with SIGTERM was that it did nothing, since it was still
> > waiting for the (single-user) client to exit, and thus had no effect
> > unless I sent an end-of-input ctrl+d singal, which would have resulted
> > in a shutdown anyway.
>
> We might need a bit of rejiggering around the edges of the single-user
> command reading code to make this work nicely, but what I'm envisioning
> is that a keyboard-generated SIGQUIT ought to result in a clean
> shutdown, same as EOF does.
>
> At least on my machine there doesn't seem to be a defined way to
> generate SIGTERM from the terminal; so I can see where if someone hasn't
> read the postgres man page carefully, their first instinct upon finding
> that control-C doesn't get them out of single-user mode might be to type
> control-\ (or whatever the local QUIT character is). It doesn't seem
> like it should be quite that easy to force a panic stop.

That seems reasonable, but I know an awful lot of people that don't know
how to generate SIGQUIT at all (I only learned about it about a year
ago, I think). In fact anyone who doesn't already know that Ctrl-D
closes the session is not very likely to know about Ctrl-\. So while we
should do it anyway, IMHO there's not much gain there. I think it may
be good to add "exit" and "quit" commands to close the standalone
session.

--
Alvaro Herrera Developer, http://www.PostgreSQL.org/
"God is real, unless declared as int"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-07-08 23:12:46 Re: Problem with autovacuum and pg_autovacuum
Previous Message Michael Glaesemann 2007-07-08 19:28:50 Re: Encoding questions

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-07-08 23:53:52 Re: [GENERAL] Unable to get postgres running after long time no vacuum
Previous Message Tom Lane 2007-07-08 22:27:49 Re: pgstat_drop_relation bugfix