Re: Command to prune archive at restartpoints - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Command to prune archive at restartpoints
Date
Msg-id 4C10F8DC.8050708@dunslane.net
Whole thread Raw
In response to Re: Command to prune archive at restartpoints  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Command to prune archive at restartpoints
List pgsql-hackers

Robert Haas wrote:
>> It won't kill us to change that sentence. "pg_standby is only used now
>> within the cleanup command" etc
>>
>> pg_standby already contains the exact logic we need here. Having two
>> sets of code for the same thing isn't how we do things.
>>     

Well, we could factor out that part of the code so it could be used in 
two binaries. But ...

>>> Maybe we could add a new pg_cleanuparchive binary, but we'll need some
>>> discussion...
>>>       
>> Which will go nowhere, as we both already know.
>>     
>
> I have a feeling that I may be poking my nose into an incipient
> shouting match, but FWIW I agree with Heikki that it would be
> preferable to keep this separate from pg_standby.  Considering that
> Andrew wrote this in 24 lines of Perl code (one-third of which are
> basically just there for logging purposes), I'm not that worried about
> code duplication, unless what we actually need is significantly more
> complicated.
>
>   

I think my logic needs a tiny piece of adjustment, to ignore the 
timeline segment of the file name. But that will hardly involve a great 
deal of extra code - just chop off the first 8 chars. It's not like the 
code for this in pg_standby.c is terribly complex.

The virtue of a perl script is that it's very easily customizable, e.g. 
you might only delete files if they are older than a certain age.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: warning message in standby
Next
From: "Luxenberg, Scott I."
Date:
Subject: Error with GIT Repository