Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: michael(at)paquier(dot)xyz, t(dot)bussmann(at)gmx(dot)net, tgl(at)sss(dot)pgh(dot)pa(dot)us, markguertin(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files
Date: 2023-04-27 14:22:08
Message-ID: 7B26A7F6-375B-451A-8B6B-FD1CCA23FFEE@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 21 Apr 2023, at 05:02, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote:

> After applying the change, sendDir excludes some files in the the
> following steps.
>
> 1. Excludes "." and ".." quietly.
>
> 2. Excludes files starting with "pgsql_tmp", quietly.
>
> 3. (new) Excludes files begins with '.', quietly.
>
> (checks signal)
>
> 4. Excludes everything suggested by excludeFiles then reports the
> excluded files using DEBUG1.
>
> 5. Excludes files based on more complex conditions.
>
> These steps seem a bit arbitrary. Is there any reason we keep step 1
> seprate from step 3,

I'm not sure I follow. While "." and ".." and hidden files share a leading '.'
character they are vastly different and combining them in the same check would
trade lines of code for readability. I'm not sure that's a net win. If you
mean that the checks should be reordered such that hidden files are checked for
before "pgsql_tmp", then that seems equally arbitrary no? There is no reason
to believe that hidden files would be more frequently found than "pgsql_tmp
files. I don't have strong opinions on the order, I'm just not sure either is
better than the other.

> and step 2 seprate from step 4?

The commit message for 6ad8ac60262 doesn't explain why pgsql_tmp was left out
of the excludeFiles table, but my guess is that it's either an optimization or
a deliberate choice to not DEBUG1 log skipping temporary files. I didn't go
digging in the archives to find the corresponding thread but there might be
clues to be had there.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-04-27 14:46:29 Re: BUG #17908: plpython_to_hstore() crashes with a non-dict argument
Previous Message Richard Guo 2023-04-27 10:28:28 Re: BUG #17909: CREATE SCHEMA AUTHORIZATION sch CREATE TABLE foo ( id INT ) will coredump