Skip site navigation (1) Skip section navigation (2)

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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Marti Raudsepp <marti(at)juffo(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch review for logging hooks (CF 2012-01)
Date: 2012-01-18 16:41:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Excerpts from Andrew Dunstan's message of mié ene 18 13:27:40 -0300 2012:
> On 01/18/2012 11:12 AM, Martin Pihlak wrote:
> > 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.
> Hmm, interesting. I don't think I've encountered a situation where 
> backends would actually stall.

You have to have really high velocity for this to happen.  At least one
customer of ours has suffered this problem (I vaguely recall a second
case but I'm not really sure), having had to switch to syslog (which
uses lossy sockets, with the advantage that it doesn't cause stalls).

> But in any case, I don't think we have to 
> be that deterministic. The only thing that needs to be absolutely 
> guaranteed is that the log messages from a given backend are in order. 
> Some slight fuzz between backends seems acceptable.


Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

pgsql-hackers by date

Next:From: Dimitri FontaineDate: 2012-01-18 19:03:29
Subject: Re: Command Triggers
Previous:From: Andrew DunstanDate: 2012-01-18 16:27:40
Subject: Re: Patch review for logging hooks (CF 2012-01)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group