Re: Streaming Replication and archiving

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Streaming Replication and archiving
Date: 2010-01-21 13:57:01
Message-ID: 407d949e1001210557r6fdd1d22m7d1e6b78a261a67e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 21, 2010 at 1:48 AM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>> Huh?  *Archived* segments aren't supposed to get deleted, at least not
>> by any automatic Postgres action.  It would be up to the DBA how long
>> he wants to keep them around.
>
> OK.  The docs indicated that the segments needed to be kept around in
> case the slave fell behind.  If that's not the case (as it appears not
> to be) then they can just be deleted by cron job, or the archive_command
> on the master can be changed.

It's definitely the case.

Generally speaking each base backup image has an oldest archived log
which is needed to make it useful. And each standby database -- which
is just a recovered base backup which has been rolled forward some
distance already -- also has one.

What would be useful is a tool which given a list of standby databases
and list of base backup images can apply a set of policy rules to
determine which base backups and archived logs to delete.

The policy might look something like "keep one base backup per week
going back a month and one per day going back seven days and keep
archived logs going back far enough for any of these base backups or
any of these live replicas."

Bonus points if you can say "also keep one base backup per month going
back three years with just enough archived logs to recover the base
backup to a consistent state".

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2010-01-21 14:07:21 Re: 8.5 vs. 9.0
Previous Message Fujii Masao 2010-01-21 13:44:15 Streaming replication and a disk full in primary