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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files
Дата
Msg-id ZLjmnOdz5jT+2s4g@paquier.xyz
обсуждение исходный текст
Ответ на Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-bugs
On Thu, Jul 20, 2023 at 01:16:45AM +0200, Daniel Gustafsson wrote:
> Attached is a version that just skips .DS_Store files as per the discussion
> here.  I opted for not testing this on macOS since I don't want to create
> invalid .DS_Store files where they potentially can be seen by the Finder
> causing unwanted side effects.


@@ -398,6 +398,10 @@ recurse_dir(const char *datadir, const char *parentpath,
            strcmp(xlde->d_name, "..") == 0)
            continue;

+       /* Skip macOS system files */
+       if (strcmp(xlde->d_name, ".DS_Store") == 0)
+           continue;

Hmm.  Are you sure that this is correct for pg_rewind?  This should
work when using a local source with --source-pgdata, but under a
remote source with --source-pgdata, I get the impression that we'd
still copy a .DS_store into the target's data folder.

For example, see this little tweak in 003_extrafiles.pl that adds a
.DS_Store in the standby:
--- a/src/bin/pg_rewind/t/003_extrafiles.pl
+++ b/src/bin/pg_rewind/t/003_extrafiles.pl
@@ -53,6 +53,9 @@ sub run_test
    append_to_file
      "$test_standby_datadir/tst_standby_dir/standby_subdir/standby_file4",
      "in standby4";
+   append_to_file
+     "$test_standby_datadir/tst_standby_dir/.DS_Store",
+     "in standby4";

Note that I have not updated the list associated to is_deeply(), to
check that this file is not copied over to the primary.  This leads me
to a failure of the test for the remote case.  Then, looking from
src/bin/pg_rewind/:
$ find . -name ".DS_Store"
./tmp_check/t_003_extrafiles_primary_remote_data/pgdata/tst_standby_dir/.DS_Store
./tmp_check/t_003_extrafiles_standby_local_data/pgdata/tst_standby_dir/.DS_Store
./tmp_check/t_003_extrafiles_standby_remote_data/pgdata/tst_standby_dir/.DS_Store
--
Michael

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: BUG #18014: Releasing catcache entries makes schema_to_xmlschema() fail when parallel workers are used
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: BUG #18014: Releasing catcache entries makes schema_to_xmlschema() fail when parallel workers are used