Re: New option in pg_basebackup to exclude pg_log files during base backup

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Prabakaran, Vaishnavi" <vaishnavip(at)fast(dot)au(dot)fujitsu(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New option in pg_basebackup to exclude pg_log files during base backup
Date: 2014-04-09 14:45:23
Message-ID: CABUevEw3h93DzsH-CY==bmprYXkC9v4S1Zz51Bh8-Pu2jMeDcA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 9, 2014 at 2:06 AM, Prabakaran, Vaishnavi <
vaishnavip(at)fast(dot)au(dot)fujitsu(dot)com> wrote:

> Hi all,
>
>
>
> Following the discussion in message id -
> CAHGQGwFFMOr4EcugWHZpAaPYQbsEKDg66VmJ1rveJ6Z-EgaqAg(at)mail(dot)gmail(dot)com , I
> have developed the patch which gives option to user to exclude pg_log
> directory contents in pg_basebackup.
>
>
>
> [Current situation]
>
> During pg_basebackup, all files in pg_log directory will be copied to new
> backup directory.
>
>
>
> [Design]
>
> - Added new non-mandatory option "-S/--skip-log-dir" to pg_basebackup .
>
> - If "skip-log-dir" is specified in pg_basebackup command, then in
> basebackup, exclude copying log files from standard "pg_log" directory and
> any other directory specified in Log_directory guc variable. (Still empty
> folder "pg_log"/$Log_directory will be created)
>
> - In case, pg_log/$Log_directory is symbolic link, then an empty folder
> will be created
>
>
>
> [Advantage]
>
> It gives an option to user to avoid copying of large log files if they
> doesn't wish to and hence can save memory space.
>
>
>
>
>
While pg_log is definitely the most common one being the default on many
platforms, we'll still be missing other ones. Should we really hardcode it,
or should we somehow derive it from the settings for log_directory instead?

As a more general discussion, is this something we might want to expose as
a more general facility rather than hardcode it to the log directory only?
And is it perhaps something we'd rather have configured at the server than
specified in pg_basebackup - like a guc saying which directories should
always be excluded from a basebackup? So you don't have to remember it
every time?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-04-09 14:55:50 Re: New option in pg_basebackup to exclude pg_log files during base backup
Previous Message Andres Freund 2014-04-09 14:30:50 Re: [RFC, POC] Don't require a NBuffer sized PrivateRefCount array of local buffer pins