Re: PITR Recovery Question

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-admin(at)postgresql(dot)org>,<gnanam(at)zoniac(dot)com>
Cc: <fgp(at)phlo(dot)org>
Subject: Re: PITR Recovery Question
Date: 2010-06-04 15:02:53
Message-ID: 4C08CF4D0200002500031F44@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

"Gnanakumar" <gnanam(at)zoniac(dot)com> wrote:

> My pg_xlog/ and walarchive/ directory locations are
> "/usr/local/pgsql/data/pg_xlog" and "/mnt/pitr/walarchive"
> respectively.
>
> In case, if I decide to clean the old WAL archives and set right
> PITR from today onwards by taking base backup, so that I can start
> managing and maintaining atleast from now onwards, what is the
> correct way/method of removing files from pg_xlog/,
> pg_xlog/archive_status/ and /mnt/pitr/walarchive/ directories?

It is generally unsafe to delete any WAL files from pg_xlog. If
they are there because your archive command has been failing, you
need to turn off archiving or (probably more convenient) allow the
archive script to return success until things clear. One trick
would be to temporarily change your archive_command to 'true',
delete all files from your archive, and then change the command
back. Doing that without exposing yourself to a period where you
have no backup might be tricky, though.

If the only problem with the archive command is that the archive fs
is full, I would copy the contents of the archive directory to tape
or whatever medium you have for long-term storage, delete the
contents, and let archive succeed. The pg_xlog directory will
eventually clear, and then I would get a fresh PITR base backup
(following all the documented steps for doing so). You really want
to see WAL files flowing to your archive location before you start
the process of getting a new base backup.

If there's some other reason that the archive command has been
failing, what is it?

-Kevin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message RBN 2010-06-04 15:25:55 Filesystem and PG configuration
Previous Message Gnanakumar 2010-06-04 11:54:14 PITR Recovery Question

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2010-06-04 15:06:26 Re: Did we really want to force an initdb in beta2?
Previous Message Robert Haas 2010-06-04 14:57:50 Re: Idea for getting rid of VACUUM FREEZE on cold pages