Re: Using base backup exclusion filters to reduce data transferred with pg_rewind

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using base backup exclusion filters to reduce data transferred with pg_rewind
Date: 2018-03-28 20:01:40
Message-ID: CAHGQGwF_8suF4c_YvEPG=qxLgm2D8e4Tt=NVf6D=oRxQc-eZuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 28, 2018 at 7:54 AM, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> On Wed, Mar 28, 2018 at 04:13:25AM +0900, Fujii Masao wrote:
>> This code is almost ok in practice, but using the check of
>> "strstr(path, localpath) == path" is more robust here?
>
> No problems with that either.
>
>> Using the following code instead is more robust?
>> This original code is almost ok in practice, though.
>>
>> filename = last_dir_separator(path);
>> if (filename == NULL)
>> filename = path;
>> else
>> filename++;
>> if (strcmp(filename, excludeFiles[excludeIdx]) == 0)
>
> Indeed, using last_dir_separator is a better idea for files. I was
> looking for something like that actually.
>
>> + (everything except the relation files). Similarly to base backups,
>> + the contents of the directories <filename>pg_dynshmem/</filename>,
>> + <filename>pg_notify/</filename>, <filename>pg_replslot/</filename>,
>> + <filename>pg_serial/</filename>, <filename>pg_snapshots/</filename>,
>> + <filename>pg_stat_tmp/</filename>, and
>> + <filename>pg_subtrans/</filename> are omitted from the data copied
>> + from the source cluster. Any file or directory beginning with
>> + <filename>pgsql_tmp</filename> is omitted, as well as are
>> + <filename>backup_label</filename>,
>> + <filename>tablespace_map</filename>,
>> + <filename>pg_internal.init</filename>,
>> + <filename>postmaster.opts</filename> and
>> + <filename>postmaster.pid</filename>.
>>
>> I don't think this description is necessary. The doc for pg_basebackup
>> also doesn't seem to have this kind of description.
>
> Those are listed in backup.sgml. And I really think that we should at
> least document that the same type of exclusion filters as base backups
> are used in pg_rewind.

Okay, I revived that change in the doc.

>> So attached is the patch that I updated based on your patch and
>> am thinking to apply.
>
> Thanks. Except for the documentation part, I am OK for the changes
> proposed.

Committed. Thanks!

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2018-03-28 20:32:46 Re: csv format for psql
Previous Message Joshua D. Drake 2018-03-28 19:43:07 Re: csv format for psql