Re: Patch review for logging hooks (CF 2012-01)

Поиск
Список
Период
Сортировка
От Martin Pihlak
Тема Re: Patch review for logging hooks (CF 2012-01)
Дата
Msg-id 4F16EF81.9070106@gmail.com
обсуждение исходный текст
Ответ на Re: Patch review for logging hooks (CF 2012-01)  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: Patch review for logging hooks (CF 2012-01)  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On 01/18/2012 03:56 AM, Fujii Masao wrote:
> or syslog process (if you use syslog). So ISTM that there is no
> guarantee that the order of log messages processed by the
> hook is same as that of messages written to the log file. For
> example, imagine the case where two backends call EmitErrorReport()
> at the same time. Is this OK? If not, the hook might need to be
> in syslogger.

For high volume logging I'd avoid going through the syslogger. One
big issue with syslogger is that it creates a choke point - everything
has to pass through it, and if it cannot keep up it starts stalling
the backends. Also, in EmitErrorReport the hook gets to have access
to the actual ErrorData structure -- that makes filtering and looking
at message content much simpler.

> EmitErrorReport() can be called before shared library like Martin's
> pg_logforward is preloaded. Which means that the hook may miss
> some log messages. Is this OK?
> 

True, even though the shared or local preload libraries are loaded
quite early in PostmasterMain/PostgresMain there is a chance that
some messages (mostly initialization failures) are missed. I guess
there is no way to avoid this with module based approach. But IMHO
this is acceptable -- when the backend fails to initialise, it cannot
be  assumed that the logging subsystem is set up properly. I guess it
deserves at least a comment though. Thanks for pointing this out.

regards,
Martin


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: patch: fix SSI finished list corruption
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Patch review for logging hooks (CF 2012-01)