1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-31 17:02:12 +03:00

pg_archivecleanup: Add --clean-backup-history

By default, pg_archivecleanup does not remove backup history files.
These are just few bytes useful for debugging purposes, still keeping
them around can bloat an archive path history files mixed with the WAL
segments if the path has a long history.

This patch adds a new option to control if backup history files are
removed, depending on the oldest segment name to keep around.

While on it, the TAP tests are refactored so as these are now able to
handle lists of files.  Each file has a flag to track if it should still
exist or not depending on the oldest segment defined with the command
run.

Author: Atsushi Torikoshi
Reviewed-by: Kyotaro Horiguchi, Fujii Masao, Michael Paquier
Discussion: https://postgr.es/m/d660ef741ce3d82f3b4283f1cafd576c@oss.nttdata.com
This commit is contained in:
Michael Paquier
2023-07-19 13:41:22 +09:00
parent 4a7556f77c
commit 3f8c98d0b6
3 changed files with 115 additions and 38 deletions

View File

@@ -93,6 +93,18 @@ pg_archivecleanup: removing file "archive/00000001000000370000000E"
<variablelist>
<varlistentry>
<term><option>-b</option></term>
<term><option>--clean-backup-history</option></term>
<listitem>
<para>
Remove backup history files as well.
See <xref linkend="backup-base-backup"/> for details about backup
history files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option></term>
<term><option>--debug</option></term>