pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Alexander Kukushkin <cyberdemn@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: csvlog gets crazy when csv file is not writable
Date: Sun, 26 Aug 2018 15:51:11 -0400
Message-ID: <15916.1535313071@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+q6zcUHivMWerY6_aMB-T76zyU3egJz8A6OwfLH_FCfKYR=5w@mail.gmail.com>
References: <CAFh8B==iLUD_gqC-dAENS0V+kVrCeGiKujtKqSQ7++S-caaChw@mail.gmail.com>
	<20180821022342.GD2897@paquier.xyz>
	<CA+q6zcUer3kfbkya8btE_AME+fPnd=oJHmoB_gaj=5dfafRC4A@mail.gmail.com>
	<6508.1535236772@sss.pgh.pa.us>
	<CA+q6zcUHivMWerY6_aMB-T76zyU3egJz8A6OwfLH_FCfKYR=5w@mail.gmail.com>

Dmitry Dolgov <9erthalion6@gmail.com> writes:
>> On Sun, 26 Aug 2018 at 00:39, Tom Lane <tgl@sss.pgh.pa.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




view thread (6+ messages)

Message-ID: <15916.1535313071@sss.pgh.pa.us>
Permalink:  ../15916.1535313071@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15916.1535313071@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, 9erthalion6@gmail.com, michael@paquier.xyz, cyberdemn@gmail.com
  Subject: Re: csvlog gets crazy when csv file is not writable
  In-Reply-To: <15916.1535313071@sss.pgh.pa.us>
  References: <CAFh8B==iLUD_gqC-dAENS0V+kVrCeGiKujtKqSQ7++S-caaChw@mail.gmail.com> <20180821022342.GD2897@paquier.xyz> <CA+q6zcUer3kfbkya8btE_AME+fPnd=oJHmoB_gaj=5dfafRC4A@mail.gmail.com> <6508.1535236772@sss.pgh.pa.us> <CA+q6zcUHivMWerY6_aMB-T76zyU3egJz8A6OwfLH_FCfKYR=5w@mail.gmail.com> <15916.1535313071@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox