Re: Log notice that checkpoint is to be written on shutdown

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Log notice that checkpoint is to be written on shutdown
Дата
Msg-id 20141003150723.GA7043@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Log notice that checkpoint is to be written on shutdown  (Michael Banck <michael.banck@credativ.de>)
Ответы Re: Log notice that checkpoint is to be written on shutdown
Список pgsql-hackers
Michael Banck wrote:

> diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
> index 5a4dbb9..f2716ae 100644
> --- a/src/backend/access/transam/xlog.c
> +++ b/src/backend/access/transam/xlog.c
> @@ -8085,10 +8085,14 @@ CreateCheckPoint(int flags)
>  
>      /*
>       * If enabled, log checkpoint start.  We postpone this until now so as not
> -     * to log anything if we decided to skip the checkpoint.
> +     * to log anything if we decided to skip the checkpoint.  If we are during
> +     * shutdown and checkpoints are not being logged, add a log message that a 
> +     * checkpoint is to be written and shutdown is potentially delayed.
>       */
>      if (log_checkpoints)
>          LogCheckpointStart(flags, false);
> +    else if (shutdown)
> +        ereport(LOG, (errmsg("waiting for checkpoint ...")));
>  
>      TRACE_POSTGRESQL_CHECKPOINT_START(flags);

I think if we're going to emit log messages for shutdown checkpoints, we
ought to use the same format we already have, i.e. instead of having the
separate "waiting for checkpoint" message, just test "log_checkpoints ||
shutdown", then LogCheckpointStart.  And for consistency also make sure
that the checkpoint end log line is also reported on shutdown
checkpoints regardless of log_checkpoints.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bogdan Pilch
Дата:
Сообщение: Trailing comma support in SELECT statements
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Escaping from blocked send() reprised.