Michael Banck-2 wrote > Hi, > > 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. > > In order to alert those users that a checkpoint is being written, I > propose to add a log message "waiting for checkpoint ..." on shutdown, > even if log_checkpoints is disabled, as this particular checkpoint might > be important information. > > I've attached a trivial patch for this, should it be added to the next > commitfest?
Peeking at this provokes a couple of novice questions: While apparently it is impossible to have a checkpoint to log at recovery end the decision to use the bitwise-OR instead of the local "shutdown" bool seemed odd at first... LogCheckpointStart creates the log entry unconditionally - leaving the caller responsible for evaluating log_checkpoints - while LogCheckpointEnd has the log_checkpoints condition built into it. I mention this because by the same argument advocating the logging of the checkpoint start we should also log its end. In order to do that here, though, we have to change log_checkpoints before calling LogCheckpointEnd. Now, since we going to shutdown anyway that seems benign (and forecloses on any need to set it back to the prior value) but its still ugly. Just some thoughts... The rationale makes perfect sense. +1 David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Log-notice-that-checkpoint-is-to-be-written-on-shutdown-tp5821394p5821417.html Sent from the PostgreSQL - hackers mailing list archive at Nabble.com. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers