Re: Fixing syslogger rotation logic for first-time case - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Fixing syslogger rotation logic for first-time case
Date
Msg-id 000301cd6fe5$6c616ad0$45244070$@kapila@huawei.com
Whole thread Raw
In response to Fixing syslogger rotation logic for first-time case  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.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
shouldtruncate the log file -- working fine
 


With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: [PATCH] Make "psql -1 < file.sql" work as with "-f"
Next
From: Robert Haas
Date:
Subject: Re: New statistics for WAL buffer dirty writes