Re: restoring wal archive and pg_xlog dir

From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: restoring wal archive and pg_xlog dir
Date: 2005-06-23 18:41:17
Message-ID: Pine.LNX.4.63.0506231137160.21285@discord.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, 23 Jun 2005, Tom Lane wrote:

> Segment files pulled from the archive are saved using temporary file
> names (and then deleted after being replayed). For obvious safety
> reasons, we try never to overwrite any xlog file in either the archive
> or local storage.

So, that, immediately begs the question as to why the docs indicate we should
clear out all the files in the pg_xlog directory before beginning the restore?
Wouldn't it be better to keep them in place? Or am I missing a big picture
item.

>> I also noticed that if there is not at least one wal archive available in
>> the archive or the pg_xlog dir, the restore errors out and exits. So the
>> base backup is really not complete without at least one wal archive
>> following it. Is this by design?
>
> Certainly. If you don't have wal data spanning the entire time that the
> base backup is being taken, the backup is useless because there's no way
> to make it consistent.

Ohhhh...I guess I misunderstood the meaning of base backup. So, what I really
need if my .backup file is named: 000000010000000500000051.00FB6C60.backup,
then I need at least the following to do a restore:

pg_xlog/000000010000000500000051
PGDATA base backup

and then any archived wal files that come after 51?

The background on this is that I'm trying to script up a one script restore
solution and my testing has me running into the occassional surprise.

--
Jeff Frost, Owner <jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2005-06-23 18:59:20 Re: restoring wal archive and pg_xlog dir
Previous Message Tom Lane 2005-06-23 18:24:42 Re: restoring wal archive and pg_xlog dir