Skip site navigation (1) Skip section navigation (2)

Re: Command to prune archive at restartpoints

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Greg Stark <gsstark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Command to prune archive at restartpoints
Date: 2010-06-13 18:25:53
Message-ID: AANLkTil_zwXnjwqRFIu30T3I8CaoJYFmURmrrBwQ_pE5@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sun, Jun 13, 2010 at 1:04 PM, Dimitri Fontaine
<dfontaine(at)hi-media(dot)com> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> I'm a bit perplexed here.  The archive cleanup has to run on the
>> standby, not the master, right?  Whereas pg_switch_xlog() can only run
>> on the master.
>
> I used it just to show a possible use case, easy to grasp. Sorry if
> that's confusing instead.
>
>>  The purpose of making this a standalone executable is
>> so that people who have, for example, multiple standbys, can customize
>> the logic without having to hack the backend.  Pushing this into the
>> backend would defeat that goal; plus, it wouldn't be usable at all for
>> people who aren't running Hot Standby.
>
> In the simple cases, what you want to be able to easily choose is just
> the first XLOG file you're NOT cleaning. And this is the only argument
> you give the function.
>
> So you can either use the backend function as your internal command for
> archive cleanup, or use a script that choose where to stop cleaning then
> call it with that as an argument (it's SQL callable).
>
> What it does is unlink the file. If that behavior doesn't suit you, it's
> still possible to use an external command and tune some already proposed
> scripts. I just don't see how an external binary has more to offer than
> a backend function here. It's more code to maintain, it's harder to
> setup for people, and if it does not suit you, you still have to make
> you own script but you can not use what we ship easily (you have to get
> the sources and code in C for that).
>
> What I'm after is being able to tell people to just setup a GUC to a
> given value, not to copy/paste a (perl or bash) script from the docs,
> make it executable under their system, then test it and run it in
> production. We can do better than that, and it's not even hard.

We're not going to make them cut/paste anything from the docs.  We're
going to provide a production-ready executable they can just use,
which should be installed (presumably, already with the correct
permissions) by their packaging system if they install
postgresql-contrib or the equivalent.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

pgsql-hackers by date

Next:From: Dimitri FontaineDate: 2010-06-13 18:51:14
Subject: Re: Command to prune archive at restartpoints
Previous:From: Dimitri FontaineDate: 2010-06-13 17:04:28
Subject: Re: Command to prune archive at restartpoints

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group