Re: Log notice that checkpoint is to be written on shutdown - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: Log notice that checkpoint is to be written on shutdown
Date
Msg-id CAMkU=1z=5qG6swPSL2zubfjArJO3Z1WeWK04i5E9swupQP0U1Q@mail.gmail.com
Whole thread Raw
In response to Re: Log notice that checkpoint is to be written on shutdown  (Michael Banck <michael.banck@credativ.de>)
List pgsql-hackers
On Wed, Oct 8, 2014 at 10:52 AM, Michael Banck <michael.banck@credativ.de> wrote:
Hi,

Am Samstag, den 04.10.2014, 15:05 -0500 schrieb Jim Nasby:
> On 10/4/14, 1:21 PM, Jeff Janes wrote:
> > On Thu, Oct 2, 2014 at 6:21 AM, Michael Banck wrote:
> >     we have seen repeatedly that users can be confused about why PostgreSQL
> >     is not shutting down even though they requested it. Usually, this is
> >     because `log_checkpoints' is not enabled and the final checkpoint is
> >     being written, delaying shutdown. As no message besides "shutting down"
> >     is written to the server log in this case, we even had users believing
> >     the server was hanging and pondering killing it manually.
> >
> >
>> Wouldn't a better place to write this message be the terminal from
>> which "pg_ctl stop" was invoked, rather than the server log file?

Looking at it from a DBA perspective, this would indeed be better, yes.

However, I see a few issues with that:

1. If you are using an init script (or another wrapper around pg_ctl),
you don't get any of its output it seems.

2. Having taken a quick look at pg_ctl, it seems to just kill the
postmaster on shutdown and wait for its PID file to disappear.  I don't
see how it should figure out that PostgreSQL is waiting for a checkpoint
to be finished?

It could just print out a reminder that a checkpoint will occur, depending on what mode of shutdown was requested.  I don't think this reminder has be validated by the server itself, the intention should be enough.

Most people who don't know that a clean shutdown inherently involves a checkpoint probably don't monitor the server log closely, either.  Of course if they use packager scripts to do the shutdown and those scripts don't pass along the message, I guess that still doesn't help.
 
Cheers,

Jeff

pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Corporate and Individual Contributor License Agreements (CLAs)
Next
From: "Joshua D. Drake"
Date:
Subject: Expose options to explain? (track_io_timing)