Re: PATCH: Exclude additional directories in pg_basebackup

From: David Steele <david(at)pgmasters(dot)net>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Subject: Re: PATCH: Exclude additional directories in pg_basebackup
Date: 2016-09-07 12:21:57
Message-ID: 3fec9ea5-3018-7b5a-2796-3e19343ca13f@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/6/16 10:25 PM, Michael Paquier wrote:
> On Wed, Sep 7, 2016 at 12:16 AM, David Steele <david(at)pgmasters(dot)net> wrote:
>> Attached is a new patch that adds sgml documentation. I can expand on each
>> directory individually if you think that's necessary, but thought it was
>> better to lump them into a few categories.
>
> + be ommitted from the backup as they will be initialized on postmaster
> + startup. If the <xref linkend="GUC-STATS-TEMP-DIRECTORY"> is set and is
> + under the database cluster directory then the contents of the directory
> + specified by <xref linkend="GUC-STATS-TEMP-DIRECTORY"> can also
> be ommitted.
>
> s/ommitted/omitted/

Thanks!

> +#define EXCLUDE_DIR_MAX 8
> +#define EXCLUDE_DIR_STAT_TMP 0
> +
> +const char *excludeDirContents[EXCLUDE_DIR_MAX] =
> +{
> + /*
> + * Skip temporary statistics files. The first array position will be
> + * filled with the value of pgstat_stat_directory relative to PGDATA.
> + * PG_STAT_TMP_DIR must be skipped even when stats_temp_directory is set
> + * because PGSS_TEXT_FILE is always created there.
> + */
> + NULL,
> I find that ugly. I'd rather use an array with undefined size for the
> fixed elements finishing by NULL, remove EXCLUDE_DIR_MAX and
> EXCLUDE_DIR_STAT_TMP and use a small routine to do the work done on
> _tarWriteHeader...

My goal was to be able to fully reuse the code that creates the paths,
but this could also be done by following your suggestion and also moving
the path code into a function.

Any opinion on this, Peter?

--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2016-09-07 12:28:45 Re: PATCH: Exclude additional directories in pg_basebackup
Previous Message Tomas Vondra 2016-09-07 12:14:03 Re: Speed up Clog Access by increasing CLOG buffers