Re: Allow pg_archivecleanup to remove backup history files

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: torikoshia(at)oss(dot)nttdata(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow pg_archivecleanup to remove backup history files
Date: 2023-04-25 08:29:48
Message-ID: 20230425.172948.1630351042955772893.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 25 Apr 2023 16:38:16 +0900, torikoshia <torikoshia(at)oss(dot)nttdata(dot)com> wrote in
> Hi,
>
> Currently pg_archivecleanup doesn't remove backup history files even
> when they're older than oldestkeptwalfile.
>
> Of course the size of backup history files are smaller than WAL files
> and they wouldn't consume much disk space, but a lot of backup history
> files(e.g. daily backup for years) whose backups data have been
> already removed are unnecessary and I would appreciate if
> pg_archivecleanup has an option to remove them.
>
> Attached a PoC patch, which added new option -b to remove files
> including backup history files older than oldestkeptwalfile.
>
> $ ls archivedir
> 000000010000000000000001 000000010000000000000003
> 000000010000000000000006
> 000000010000000000000008
> 000000010000000000000002 000000010000000000000004
> 000000010000000000000007
> 000000010000000000000009
> 000000010000000000000002.00000028.backup 000000010000000000000005
> 000000010000000000000007.00000028.backup
> 00000001000000000000000A.partial
>
> $ pg_archivecleanup -b archivedir 000000010000000000000009
>
> $ ls archivedir
> 000000010000000000000009 00000001000000000000000A.partial
>
> Any thoughts?

I thought that we have decided not to do that, but I coundn't find any
discussion about it in the ML archive. Anyway, I think it is great
that we have that option.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2023-04-25 09:20:40 Re: Missing update of all_hasnulls in BRIN opclasses
Previous Message Pavel Stehule 2023-04-25 08:27:59 enhancing plpgsql debug api - hooks on statements errors and function errors