Re: Allow pg_archivecleanup to remove backup history files

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow pg_archivecleanup to remove backup history files
Date: 2023-05-12 08:53:45
Message-ID: 61abc656edfba4a668b367d590b1aaab@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-05-10 17:52, Bharath Rupireddy wrote:
Thanks for your comments!

> Just curious to know the driving point behind this proposal - is
> pg_archivecleanup deployed in production that was unable to clean up
> the history files and there were many such history files left? It will
> help us know how pg_archivecleanup is being used.

Yes.

> Just curious to know the driving point behind this proposal - is
> pg_archivecleanup deployed in production that was unable to clean up
> the history files and there were many such history files left? It will
> help us know how pg_archivecleanup is being used.
>
> I'm wondering if making -x generic with '-x' '.backup', is simpler
> than adding another option?

Since according to the current semantics, deleting backup history files
with -x demands not '-x .backup' but '-x .007C9330.backup' when the file
name is 0000000100001234000055CD.007C9330.backup, it needs special
treatment for backup history files, right?

I think it would be intuitive and easier to remember than new option.

I was a little concerned about what to do when deleting both the files
ending in .gz and backup history files.
Is making it possible to specify both "-x .backup" and "-x .gz" the way
to go?

I also concerned someone might add ".backup" to WAL files, but does that
usually not happen?

> Comments on the patch:
> 1. Why just only the backup history files? Why not remove the timeline
> history files too? Is it because there may not be as many tli switches
> happening as backups?

Yeah, do you think we should also add logic for '-x .history'?

> 2.+sub remove_backuphistoryfile_run_check
> +{
> Why to invent a new function when run_check() can be made generic with
> few arguments passed?

Thanks, I'm going to reconsider it.

--
Regards,

--
Atsushi Torikoshi
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexey Gordeev 2023-05-12 09:45:42 Re: Orphaned files in base/[oid]
Previous Message Pavel Stehule 2023-05-12 08:31:01 Re: psql tests hangs