Re: WAL recovery question - 0000001.history

From: andy(at)andycc(dot)net
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: WAL recovery question - 0000001.history
Date: 2006-04-29 13:29:53
Message-ID: iyhk5t.v0mji1@webmail.mailnetwork.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Tom,Thanks for this.&nbsp; Do you know why Postgres was asking for
00000001.history?&nbsp; Surely it would know by the presence of the
backup_label file, and its contents&nbsp;that it needs to go straight for the
xxxxxx.backup file, which should exist?What other files is&nbsp;Postgres
likely to be asked for during a PITR restore?&nbsp; Obviously log files that
don't exist do need to be waited for - hence the need for this script.&nbsp;
If you want PG to come back up without the log it's waiting on, you just set
the flag file and it'll come up at the next interval.So far all I can see
that's problematic is this 0000001.history file which I don't know what it is,
and it'll never exist because it was never generated on the live.The other
thing I'm building in as well, is a file-size check, so when shipping logs
directly from another server (e.g. live to standby), when the script finds a
log, it will read the file size, wait 5 seconds, then read it again - if the 2
values differ, the log is still being transferred, so it will wait for another
interval and check again before doing anything - preventing&nbsp;itself from
pinching the log while it's still being transferred, and causing errors when
PG tries to read it.This will also remove as much human intervention as
possible from the whole process.AndyTom Lane &lt;tgl(at)sss(dot)pgh(dot)pa(dot)us&gt;
wrote:&gt; &quot;Andy Shellam&quot; &lt;andy(dot)shellam(at)mailnetwork(dot)co(dot)uk&gt;
writes:&gt; &gt; Basically I've taken a dump of my live database directory
(between&gt; &gt; pg_start_backup and pg_stop_backup) calls - shipped this to
my standby, set&gt; &gt; up a recovery.conf file (which calls the rolling-WAL
script). This script&gt; &gt; is designed to wait until the log file arrives,
or a flag file is set to&gt; &gt; return code 1 to postgres.&gt; &gt; &gt;
However as soon as the recovery starts, the script is waiting for a file&gt;
&gt; called 00000001.history, which will never arrive because it was never&gt;
&gt; generated on the live box since the base backup was taken.&gt; &gt; This
is not a workable approach: your recovery script *will* be asked&gt; for files
that do not exist, and waiting for them to be supplied is not&gt; always the
right answer. Supplying an empty file instead is definitely&gt; the wrong
answer.&gt; &gt; You might be able to make it work by conditionalizing the
behavior on&gt; the format of the name being asked for.&gt; &gt; regards, tom
lane&gt; &gt; ---------------------------(end of
broadcast)---------------------------&gt; TIP 4: Have you searched our list
archives?&gt; &gt; http://archives.postgresql.org&gt; &gt;
!DSPAM:14,445239a233692110055341!&gt; &gt; &gt;
__________________________________________________________
The mail network cannot accept liability for the content
of this e-mail. It is recommended you scan it for viruses
immediately upon receipt.

Is this e-mail spam? Report it to abuse(at)mailnetwork(dot)co(dot)uk

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Warren Little 2006-04-29 14:34:18 Re: questions on toast tables
Previous Message Warren Little 2006-04-29 12:52:55 Re: questions on toast tables