Re: Fixing syslogger rotation logic for first-time case

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Fixing syslogger rotation logic for first-time case
Date: 2012-08-01 12:59:01
Message-ID: 000301cd6fe5$6c616ad0$45244070$@kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> From: pgsql-hackers-owner(at)postgresql(dot)org
[mailto:pgsql-hackers-owner(at)postgresql(dot)org]
> On Behalf Of Tom Lane

> We've had a couple of complaints recently from people who were unhappy
because the
> syslogger's log_truncate_on_rotation logic does not fire during the first
log rotation > after it's forked off from the postmaster.

>Any objections?

I have done the testing as per issue reported and below is result of same.

Configuration
----------------------
logging_collector = on
log_directory = 'pg_log'
log_filename = 'postgresql-%H.log'
log_truncate_on_rotation = on
log_rotation_age = 1h
log_rotation_size = 0

Behavior without the fix
--------------------------------
1. Problem was that on first time rotation syslogger was appending data.

Behavior After the Patch
--------------------------------
1. Startup time file should be appended. -- working fine
2. On first rotation it should truncate the log file -- working fine

With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-08-01 14:07:33 Re: New statistics for WAL buffer dirty writes
Previous Message Fabien COELHO 2012-08-01 08:28:09 [PATCH] Make "psql -1 < file.sql" work as with "-f"