Re: pg_basebackup creates a corrupt file for pg_stat_tmp and pg_replslot on a backup location

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup creates a corrupt file for pg_stat_tmp and pg_replslot on a backup location
Date: 2016-04-26 09:02:05
Message-ID: CAE9k0P=eTy9n0rCC0xO1Cf6TZTFRCLURo9OJJKeo2mhCgy0ULA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Knowing that pg_basebackup always creates an empty directory for
pg_stat_tmp and pg_replslot in backup location, even i think it would be
better to handle these directories in such a way that pg_basebackup
generates an empty directory for pg_replslot and pg_stat_tmp if they are
symbolic link.

PFA patch for the same.

With Regards,
Ashutosh Sharma
EnterpriseDB: *http://www.enterprisedb.com <http://www.enterprisedb.com>*

On Thu, Apr 14, 2016 at 11:57 PM, Magnus Hagander <magnus(at)hagander(dot)net>
wrote:

> On Thu, Apr 14, 2016 at 8:20 PM, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
> wrote:
>
>> Hi,
>>
>> I was just curious to know how would "*pg_basebackup*" behave if we do
>> create a symbolic link for directories other than pg_xlog/pg_tblspc.
>> However it is clearly mentioned in the documentation of pg_basebackup that
>> if a Symbolic link for the directories other than pg_tblspc and pg_xlog is
>> created then it would be skipped. But, that is not the case for pg_replslot
>> and pg_stat_tmp. Is this not an issue. Should these directories not be
>> skipped. Please let me know your thoughts on this. Thanks.
>>
>
> I agree that actually generating a corrupt tarfile is not good. But I
> think the correct fix is to actually generate an empty placeholder
> directory rather than skipping it - thereby making the backup look the same
> as it would if it was a correct directory where we just skipped the
> contents.
>
> --
> Magnus Hagander
> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
>

Attachment Content-Type Size
Allow-pg_basebackup-to-create-pg_stat_tmp-and-pg_replslot-as-an-empty-dir-if-they-are-Symbolic-link.patch text/plain 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2016-04-26 10:59:58 Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.
Previous Message Erik Rijkers 2016-04-26 08:46:33 Re: Declarative partitioning