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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>
Subject: Re: Patch review for logging hooks (CF 2012-01)
Date: 2012-01-18 01:56:46
Message-ID: CAHGQGwH+WeXA97mVBTOxbmo0-yXOPBOEkVe5K8vrUw9LAmhFSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 18, 2012 at 2:35 AM, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
>> Are there corner cases the author has failed to consider?

The hook can be executed by various processes since it's in
EmitErrorReport(). OTOH, log messages are written to the log
file by one process like syslogger (if you use csvlog or stderr)
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.

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?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2012-01-18 02:00:16 Re: Vacuum rate limit in KBps
Previous Message Robert Haas 2012-01-18 01:30:44 Re: psql \timing vs failed statements