Re: csvlog gets crazy when csv file is not writable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alexander Kukushkin <cyberdemn(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: csvlog gets crazy when csv file is not writable
Date: 2018-08-26 19:51:11
Message-ID: 15916.1535313071@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dmitry Dolgov <9erthalion6(at)gmail(dot)com> writes:
>> On Sun, 26 Aug 2018 at 00:39, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> What the attached patch does about that is to redirect CSV-format
>> output to syslogFile if we get CSV output when csvlogFile isn't open.
>> The only other plausible answer I can see is to drop such output on
>> the floor, and that seems pretty unfriendly.

> Yes, probably it's the only plausible answer for now. But then I would argue
> that in the ideal world we will redirect output, that we can't write to
> csvlogFile, to syslogFile in non-csv format, which will be less surprising. It
> would require to move the actual csv formatting logic to the syslogger, or to
> let backends to know somehow that csv log is not available at this moment
> (although I assume both options are not particularly realistic).

Yeah, something like that is what would have to happen. The second option
is a complete nonstarter though: (a) there's no feedback path and (b) even
with feedback, there'd be race conditions. It's conceivable that we could
push the formatting work down to the syslogger; but I think that would be
a net loss in both reliability and performance --- remember the syslogger
is a bottleneck for logging activities, since it's inherently not
parallel.

Given that this is such a corner-case scenario, and one that generally
implies a DBA screwup that needs to be fixed, I don't want to expend a
lot of work and potentially reduce performance in order to make it
cleaner.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message jimmy 2018-08-27 02:35:52 Re:Re: Re: Re: Bug: ERROR: invalid cache ID: 42 CONTEXT: parallel worker
Previous Message Dmitry Dolgov 2018-08-26 19:39:44 Re: csvlog gets crazy when csv file is not writable