Re: BUG #14243: pg_basebackup failes by a STATUS_DELETE_PENDING file

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: harukat(at)sraoss(dot)co(dot)jp
Cc: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14243: pg_basebackup failes by a STATUS_DELETE_PENDING file
Date: 2016-07-12 14:09:31
Message-ID: CAA4eK1KzC9ZqCDbApox18p4Mp85c7=2JuZHBQMr+EqPYKNHXOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jul 12, 2016 at 2:02 PM, <harukat(at)sraoss(dot)co(dot)jp> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14243
> Logged by: TAKATSUKA Haruka
> Email address: harukat(at)sraoss(dot)co(dot)jp
> PostgreSQL version: 9.6beta2
> Operating system: Windows
> Description:
>
>
> pg_basebackup sometimes failed on Windows by "Permission denied".
> This occured in PostgreSQL 9.1.x and I reproduced it in 9.6beta2.
>
> C:\>pg_basebackup.exe -h localhost -U postgres
> -D C:\dat\96datpg_basebackup: could not get backup header:
> ERROR: could not stat file or directory "./base/16393/16444":
> Permission denied
>
> C:\Program Files\PostgreSQL\9.6\data\base\16393>dir /q 16444
>
> C:\Program Files\PostgreSQL\9.6\data\base\16393 directory
>
> 2016/07/12 15:56 0 ... 16444
>
> Dir command says the file 16444's owner is '...'.
> It means file 16444 is in STATUS_DELETE_PENDING.
> The other processes cannot open it, so it can
> cause pg_basebackup to fail.
>
> I think pg_basebackup should ignore files which is in
> STATUS_DELETE_PENDING. But I cannot yet find an easy
> method to realize it.
>

pg_basebackup tries to backup all the files in data directory and
tablespaces. Refer Notes section of pg_basebackup documentation. I
think if it decides to skip a file with some bad status, it might also
lead to a corrupt backup. I wonder how the file has such a status?
From the name, it looks to be a valid database file.

[1] - https://www.postgresql.org/docs/devel/static/app-pgbasebackup.html

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mike Porter 2016-07-12 15:51:05 grouping treated as keyword in function return table
Previous Message thomas.berger 2016-07-12 13:36:38 BUG #14244: wrong suffix for pg_size_pretty()