[Pgpool-hackers] Found bug with debug_level

Gilles Darold gilles.darold at dalibo.com
Thu Dec 30 18:37:53 UTC 2010


Hi,

Le 30/12/2010 14:03, Tatsuo Ishii a écrit :
>> Hi,
>>
>> I found a bug when playing with pgpool yesterday. The problem is that
>> enabling debug_level to 1 into pgpool.conf doesn't has any effect as it
>> is overriden in the main.c file after getting configuration so that it
>> is only enabled when the -d command line option is present.
>>
>> I've attach a patch for that.
> Thanks for pointing it out. I will commit this.
>> The other point I want to raise is that enabling debug level is only
>> useful when pgpool is run with the -n (stay in foregroud) option because
>> when stderr is redirected to a log file (like into the init script) we
>> just catch the output of the main process and never the child's one. So
>> in this case enabling debug_level or log_statement has strictly no
>> effect. That's must be said somewhere has people may take a long time
>> to  understand why pgpool is not dumping statement in their log file.
>>
>> Fortunately we have syslog support now :-) but if we want to fix the
>> stderr logging problem we have to allow pgpool to save it into a given
>> file like with a -l logfile command line option or/and in the
>> configuration file with a 'log_to_file' option instead of letting the
>> user creating a shell redirection that is only useful at main process
>> startup.
> Problem with this aproach is we need a rog rotation functionality at
> the same time. Otherwise the logfile will become infinitely large
> until pgpool process restarts. IMO if we implement "log_to_file", we
> need our own log rotator as well. Probably these functions will be
> pretty much similar to PostgreSQL's one(aka. logging collector
> process) if we want to implement.
I don't think we have to care about log rotation, what I mean is that
there's logrotate for that.
The only thing that must happen is to close and re-open the log file at
reload signal.

 Like that people can add a logrotate rule as follow :

 /var/log/pgpool/pgpool.log
{
        rotate 4
        weekly
        missingok
        notifempty
        delaycompress
        compress
        postrotate
                /etc/init.d/pgpool reload >/dev/null 2>&1 || true
        endscript
}

That's pretty simple to explain and put in the documentation. A thing
like logging collector is a factory, I don't think we need that.

> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese: http://www.sraoss.co.jp


-- 
Gilles Darold
http://dalibo.com - http://dalibo.org



More information about the Pgpool-hackers mailing list