pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Implement "pg_ctl logrotate" command
Date: Sat, 01 Sep 2018 16:51:40 +0000
Message-ID: <E1fw97c-0003QR-9f@gemulon.postgresql.org> (raw)

Implement "pg_ctl logrotate" command

Currently there are two ways to trigger log rotation in logging collector
process: call pg_rotate_logfile() SQL-function or send SIGUSR1 signal directly
to logging collector process.  However, it's nice to have more suitable way
for external tools to do that, which wouldn't require SQL connection or
knowledge of logging collector pid.  This commit implements triggering log
rotation by "pg_ctl logrotate" command.

Discussion: https://postgr.es/m/20180416.115435.28153375.horiguchi.kyotaro%40lab.ntt.co.jp
Author: Kyotaro Horiguchi, Alexander Kuzmenkov, Alexander Korotkov

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ec74369931687885cfb6ce9dac55deefdb410086

Modified Files
--------------
doc/src/sgml/maintenance.sgml       | 34 +++++++++++++-
doc/src/sgml/ref/pg_ctl-ref.sgml    | 13 ++++++
src/backend/postmaster/postmaster.c | 18 ++++++--
src/backend/postmaster/syslogger.c  | 29 +++++++++++-
src/bin/pg_ctl/pg_ctl.c             | 89 ++++++++++++++++++++++++++++++++-----
src/bin/pg_ctl/t/004_logrotate.pl   | 42 +++++++++++++++++
src/include/postmaster/syslogger.h  |  3 ++
src/test/perl/PostgresNode.pm       | 21 +++++++++
8 files changed, 230 insertions(+), 19 deletions(-)



Message-ID: <E1fw97c-0003QR-9f@gemulon.postgresql.org>
Permalink:  ../E1fw97c-0003QR-9f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fw97c-0003QR-9f@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: akorotkov@postgresql.org
  Subject: Re: pgsql: Implement "pg_ctl logrotate" command
  In-Reply-To: <E1fw97c-0003QR-9f@gemulon.postgresql.org>
  References: <E1fw97c-0003QR-9f@gemulon.postgresql.org>

* 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