From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Cc: pgsql-bugs@postgresql.org
Subject: Re: log_collector doesn't respond to reloads
Date: Thu, 26 Apr 2012 22:26:02 -0400
Message-ID: <20658.1335493562@sss.pgh.pa.us> (raw)
In-Reply-To: <4F9A0017.2070404@agliodbs.com>
References: <4F99E37E.30904@agliodbs.com>
<18699.1335487841@sss.pgh.pa.us>
<4F99F24A.3030507@agliodbs.com>
<4F99F610.60109@catalyst.net.nz>
<20084.1335491774@sss.pgh.pa.us>
<4F9A0017.2070404@agliodbs.com>
Josh Berkus <josh@agliodbs.com> writes:
> We do have one piece of unituitive behavior here though, which forms a
> bit of a catch-22:
> 1. DBA changes the log directory
> 2. Log directory is unwriteable
> 3. Postgres continues writing to the old log_directory
> 4. SHOW log_directory displays the *new* log_directory
> I think (4) here needs to change.
Well, sorry, but you can't have that. SHOW will tell you what your own
backend thinks the value of the GUC variable is, but there is no way to
know what's happening inside the logging collector process. And I'd be
against trying to add a signaling mechanism that would support telling
you that, because it would add fragility to the logging collector, which
we don't want.
> Consider the case that time elapses before anyone discovers that logs
> are not being written to the new location,
I don't buy that argument. If things are working as intended, the
collector ought to create a new file in the commanded location
immediately. I would think any normal DBA would look for that, just
to check that the SIGHUP had worked.
We clearly need to fix the "disable rotation" logic, and I think a
good case can be made for trying a mkdir() when Log_directory changes,
but I don't see that there's more that can be done about this kind
of situation.
BTW, what log messages were you getting exactly? I'd have expected
something about "could not open log file" as well as the "disabling
automatic rotation" one.
regards, tom lane
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, josh@agliodbs.com, mark.kirkwood@catalyst.net.nz
Subject: Re: log_collector doesn't respond to reloads
In-Reply-To: <20658.1335493562@sss.pgh.pa.us>
References: <4F99E37E.30904@agliodbs.com> <18699.1335487841@sss.pgh.pa.us> <4F99F24A.3030507@agliodbs.com> <4F99F610.60109@catalyst.net.nz> <20084.1335491774@sss.pgh.pa.us> <4F9A0017.2070404@agliodbs.com> <20658.1335493562@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