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

From Simon Riggs
Subject Re: Command to prune archive at restartpoints
Date
Msg-id 1276200545.23257.8560.camel@ebony
Whole thread Raw
In response to Re: Command to prune archive at restartpoints  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Command to prune archive at restartpoints  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, 2010-06-10 at 22:49 +0300, Heikki Linnakangas wrote:
> On 10/06/10 22:24, Dimitri Fontaine wrote:
> > Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
> >> Maybe we could add a new pg_cleanuparchive binary, but we'll need some
> >> discussion...
> >
> > Would this binary ever be used manually, not invoked by PostgreSQL? As
> > it depends on the %r option to be given and to be right, I don't think
> > so.
>
> Hmm, actually it would be pretty handy. To make use of a base backup,
> you need all the WAL files following the one where pg_start_backup() was
> called. We create a .backup file in the archive to indicate that
> location, like:
>
> 00000001000000000000002F.00000020.backup
>
> So to clean up all WAL files older than those needed by that base
> backup, you would simply copy-paste that location and call
> pg_cleanuparchive:
>
> pg_cleanuparchive /walarchive/ 00000001000000000000002F

OK, sounds like we're on the same thought train.

Here's the code.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Development, 24x7 Support, Training and Services

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Command to prune archive at restartpoints
Next
From: Robert Haas
Date:
Subject: including backend ID in relpath of temp rels - updated patch