Re: Allow pg_archivecleanup to remove backup history files

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Allow pg_archivecleanup to remove backup history files
Дата
Msg-id ZHBBarvyNq2FY82v@paquier.xyz
обсуждение исходный текст
Ответ на Re: Allow pg_archivecleanup to remove backup history files  (torikoshia <torikoshia@oss.nttdata.com>)
Ответы Re: Allow pg_archivecleanup to remove backup history files  (torikoshia <torikoshia@oss.nttdata.com>)
Список pgsql-hackers
On Thu, May 25, 2023 at 11:51:18PM +0900, torikoshia wrote:
> Updated patches according to your comment.

-   ok(!-f "$tempdir/$walfiles[1]",
-       "$test_name: second older WAL file was cleaned up");
-   ok(-f "$tempdir/$walfiles[2]",
+   ok(!-f "$tempdir/@$walfiles[1]",
+       "$test_name: second older WAL/backup history file was cleaned up");
+   ok(-f "$tempdir/@$walfiles[2]",

This is still a bit confusing, because as designed the test has a
dependency on the number of elements present in the list, and the
description of the test may not refer to what's actually used (the
second element of each list is either a WAL segment or a backup
history file).  I think that I would just rewrite that so as we have a
list of WAL segments in an array with the expected result associated
to each one of them.  Basically, something like that:
my @wal_segments = (
  { name => "SEGMENT1", present => 0 },
  { name => "BACKUPFILE1", present => 1 },
  { name => "SEGMENT2", present => 0 });

Then the last part of run_check() would loop through all the elements
listed.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Allow pg_archivecleanup to remove backup history files
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: testing dist tarballs