Re: Problem with PITR recovery

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jeff Davis <jdavis-pgsql(at)empires(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem with PITR recovery
Date: 2005-04-18 04:20:40
Message-ID: 200504180420.j3I4KeS21339@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis wrote:
>
> I could still use a little clarification. It seems sort of like there is
> an extra step, like:
>
> (1) start archiving
> (2) pg_start_backup()
> (3) copy PGDATA directory with tar
> (4) pg_stop_backup()
> (5) ??
>
> And the text you have at
> http://candle.pha.pa.us/main/writings/pgsql/sgml/backup-online.html
>
> says: "To make use of this backup, you will need to keep around all the
> WAL segment files generated during and after the file system backup.".
>
> How long after? Wouldn't you be keeping the WAL segments afterward
> anyway by archiving?
>
> I've tested and been able to recover using PITR before, but I'd like a
> little clarification on the steps to make absolutely sure that the base
> backup I have is viable.
>
> Can you sort of run through the failure case again, and how to prevent
> it?

The failure case in the original docs is that you do your
pg_stop_backup(), and then delete all the WAL file before the *.backup
file that was just created. However, you do not have a valid tar backup
until you have archived all the WAL files used from the *.backup WAL
file up to the WAL file that was active at pg_stop_backup(), which is
mentioned in the *.backup file. If you went and deleted your old WAL
files anyway, without waiting for those other WAL files to be archived,
and your disk drive crashed, you wouldn't have a tar backup you could
use, and you had deleted the old WAL files you would have needed to
recover your previous tar backup.

Is there something in the current wording that needs clarification?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ElayaRaja S 2005-04-18 04:46:28 Urgent
Previous Message Jeff Davis 2005-04-18 03:25:53 Re: Problem with PITR recovery