From: Simon Riggs <simon@2ndquadrant.com>
To: Thomas F. O'Connell <tfo@sitening.com>
Cc: PGSQL Admin <pgsql-admin@postgresql.org>
Subject: Re: PITR as Online Backup Solution
Date: Fri, 03 Mar 2006 17:54:52 +0000
Message-ID: <1141408492.27729.505.camel@localhost.localdomain> (raw)
In-Reply-To: <38B613F1-5A7E-469E-AC5D-B68D24C5A307@sitening.com>
References: <38B613F1-5A7E-469E-AC5D-B68D24C5A307@sitening.com>
On Thu, 2006-03-02 at 16:38 -0600, Thomas F. O'Connell wrote:
> I'm administering a database that is not immediately a good candidate
> for replication via Slony. As an interim solution, I'd like to give
> PITR a shot. The primary goal is to have a failover scenario that
> allows for recovery within a window that's much smaller than it would
> be if the only option were the output of the previous night's
> pg_dump, and the need has arisen jointly with the fact that pg_dump
> has become an unwieldy process on this database.
>
> Here's the main question: Is it possible to replay logs continuously
> against a database that has already been recovered? The documentation
> only covers the scenario of full recovery from scratch, and I'm
> wondering if this is because this is the only scenario possible with
> the current level of PITR functionality.
> Ideally, I'd be able to take a base backup of a production system,
> copy it to a remote system, which is also the repository for segment
> files generated by archive_command, and complete the recovery process
> outlined in the docs. From that point, it would make sense to me that
> I should be able to continuously replay WAL files against the new
> database (possibly as soon as archive_command generates a new one)
> without having to purge my data directory. Is that a reasonable
> assumption?
Yes, it was designed to be able to do this.
> If so, then I need to know more about which steps to use from the
> recovery scenario presented in the docs and how to identify the state
> in which a given segment file exists.
> For instance, it's not
> immediately clear from the docs what happens to the segment files
> after recovery_command runs during the recovery scenario. It says
> those segments are copied from the archive directory, but then what?
> Are they recycled as in a basic postgres installation?
They overwrite each other, thus avoiding a build up of logs. It is
designed to support "infinite" recovery.
> Also, if this system eventually works as I expect it might be able
> to, would there ever be a reason to redo it from scratch (i.e., is
> one base backup sufficient ad infinitum)?
As long as you've read the documented caveats there are no design
limitations...but I would restart from a base backup weekly, to be sure.
It's all about certainty after all.
Best Regards, Simon Riggs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: simon@2ndquadrant.com, tfo@sitening.com
Subject: Re: PITR as Online Backup Solution
In-Reply-To: <1141408492.27729.505.camel@localhost.localdomain>
References: <38B613F1-5A7E-469E-AC5D-B68D24C5A307@sitening.com> <1141408492.27729.505.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox