From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: log_collector doesn't respond to reloads
Date: Thu, 26 Apr 2012 21:56:14 -0400
Message-ID: <20084.1335491774@sss.pgh.pa.us> (raw)
In-Reply-To: <4F99F610.60109@catalyst.net.nz>
References: <4F99E37E.30904@agliodbs.com>
<18699.1335487841@sss.pgh.pa.us>
<4F99F24A.3030507@agliodbs.com>
<4F99F610.60109@catalyst.net.nz>
Mark Kirkwood <mark.kirkwood@catalyst.net.nz> writes:
> Might be a red herring, but I was able to reproduce this if (and only
> if) I forgot to create the new dest directory before doing the reload.
> Subsequently creating the directory and reloading did not result in a
> file in the new location.
Hmm, interesting point. There's this code in there when fopen'ing the
log file fails:
/*
* ENFILE/EMFILE are not too surprising on a busy system; just
* keep using the old file till we manage to get a new one.
* Otherwise, assume something's wrong with Log_directory and stop
* trying to create files.
*/
if (errno != ENFILE && errno != EMFILE)
{
ereport(LOG,
(errmsg("disabling automatic rotation (use SIGHUP to re-enable)")));
Log_RotationAge = 0;
Log_RotationSize = 0;
}
Whoever wrote that thought that Log_RotationAge/Log_RotationSize would
get reset to normal values during SIGHUP, but it's far from clear to me
that any such thing would actually happen. However, this would only
apply to Josh's problem if he was trying to set a bogus new value of
log_directory, eg not there or not writable by postgres. In any case,
if this is the locus of the problem, there ought to be instances of that
log message in the active log file. (Josh?)
Another point here is that the syslogger will attempt to create the log
directory if it's not there ... but only once, during startup. Should
we have it repeat that after a SIGHUP?
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, mark.kirkwood@catalyst.net.nz, josh@agliodbs.com
Subject: Re: log_collector doesn't respond to reloads
In-Reply-To: <20084.1335491774@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>
* 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