Skip site navigation (1) Skip section navigation (2)

pgsql: Fix syslogger so that log_truncate_on_rotation works in thefirs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix syslogger so that log_truncate_on_rotation works in thefirs
Date: 2012-07-31 18:38:02
Message-ID: E1SwHKU-0007pV-Ng@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix syslogger so that log_truncate_on_rotation works in the first rotation.

In the original coding of the log rotation stuff, we did not bother to make
the truncation logic work for the very first rotation after postmaster
start (or after a syslogger crash and restart).  It just always appended
in that case.  It did not seem terribly important at the time, but we've
recently had two separate complaints from people who expected it to work
unsurprisingly.  (Both users tend to restart the postmaster about as often
as a log rotation is configured to happen, which is maybe not typical use,
but still...)  Since the initial log file is opened in the postmaster,
fixing this requires passing down some more state to the syslogger child
process.

It's always been like this, so back-patch to all supported branches.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/75ef476cf351b876e25f2b611fda1315c4e00ec4

Modified Files
--------------
src/backend/postmaster/postmaster.c |    6 ++++-
src/backend/postmaster/syslogger.c  |   42 ++++++++++++++++++++++++----------
2 files changed, 34 insertions(+), 14 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-07-31 21:57:12
Subject: pgsql: Fix WITH attached to a nested set operation(UNION/INTERSECT/EXC
Previous:From: Alvaro HerreraDate: 2012-07-31 15:06:04
Subject: pgsql: Fix memory and file descriptor leaks inpg_receivexlog/pg_baseba

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group