Re: missing history file

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "George Wilk" <gwilk(at)ellacoya(dot)com>,<pgsql-admin(at)postgresql(dot)org>
Subject: Re: missing history file
Date: 2007-06-29 16:21:47
Message-ID: 4684EB4A.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>>> On Fri, Jun 29, 2007 at 9:52 AM, in message <12838(dot)1183128750(at)sss(dot)pgh(dot)pa(dot)us>,
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
>> Just ignore 00000001. Recovery will work fine even if absent. Don't
>> ignore all history files though, just that one. Hmmm, come to think of
>> it, why is it requesting it at all? We should just skip that request.
>
> No, because then people would misdesign their recovery scripts to not
> be able to deal with not finding a history file. As things are, they
> will certainly be exposed to that case in any testing they do. If we
> optimize this call away, then they won't see the case until they're in
> very deep doo-doo.

We certainly were exposed to the case. We weren't able to turn up any
documenation on it, so we added these lines to our recovery script:

if [[ $1 == *.history ]] ; then
exit 1
fi

Our warm standbys have apparently been working fine since.

Is there documentation of this that we missed?

Are our warm standby databases useful at this point, or have we wandered
into very deeep doo-doo already?

Based on Simon's email, I went and modified one line of our script.
I'll paste the current form below my "signature". Please let me know
if we're off base.

-Kevin


#! /bin/bash

# Pick out county name from the back of the path.
# The value of $PWD will be: /var/pgsql/data/county/<countyName>/data
countyName=`dirname $PWD`
countyName=`basename $countyName`

while [ ! -f /var/pgsql/data/county/$countyName/wal-files/$1.gz \
-a ! -f /var/pgsql/data/county/$countyName/DONE \
-o -f /var/pgsql/data/county/$countyName/wal-files/rsync-in-progress ]
do
if [ $1 == 00000001.history ] ; then
exit 1
fi
sleep 10 # /* wait for ~10 sec */
done

gunzip < /var/pgsql/data/county/$countyName/wal-files/$1.gz > "$2"

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2007-06-29 16:47:59 Re: missing history file
Previous Message George Wilk 2007-06-29 15:22:03 Re: missing history file