Re: 9.2.3 crashes during archive recovery

From: Ants Aasma <ants(at)cybertec(dot)at>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 9.2.3 crashes during archive recovery
Date: 2013-02-16 08:40:57
Message-ID: CA+CSw_umsXMxedn6OL8s6CnMyKXs5dqjd-_RvLrNywArwyxj9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 15, 2013 at 3:49 PM, Heikki Linnakangas
<hlinnakangas(at)vmware(dot)com> wrote:
>> While this solution would help solve my issue, it assumes that the
>> correct amount of WAL files are actually there. Currently the docs for
>> setting up a standby refer to "24.3.4. Recovering Using a Continuous
>> Archive Backup", and that step recommends emptying the contents of
>> pg_xlog. If this is chosen as the solution the docs should be adjusted
>> to recommend using pg_basebackup -x for setting up the standby.
>
> When the backup is taken using pg_start_backup or pg_basebackup,
> minRecoveryPoint is set correctly anyway, and it's OK to clear out pg_xlog.

How is minRecoveryPoint supposed to get set? I just tried taking a
pg_basebackup on master running pgbench. The resulting data dir
controlfile had this:

Min recovery ending location: 0/0

The end location was not in the backup_label either.

Looking at basebackup.c the process seems to be:
1. pg_start_backup
2. copy out backup_label
3. copy out rest of the datadir
4. copy out control file
5. pg_stop_backup
6. copy out WAL
7. send backup stop location

And pg_basebackup.c only uses the stop location to decide how much WAL to fetch.

I don't see anything here that could correctly communicate min
recovery point. Maybe I'm missing something.

> Yeah, it probably could use some editing, as the underlying code has evolved
> a lot since it was written. The suggestion to clear out pg_xlog seems like
> an unnecessary complication. It's safe to do so, if you restore with an
> archive, but unnecessary.
>
> The "File System Level Backup" chapter
> (http://www.postgresql.org/docs/devel/static/backup-file.html) probably
> should mention "pg_basebackup -x", too.
>
> Docs patches are welcome..

I will give it a shot.

Ants Aasma
--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2013-02-16 15:41:56 Re: PATCH: Split stats file per database WAS: autovacuum stress-testing our system
Previous Message Bruce Momjian 2013-02-16 01:57:25 Re: Materialized views WIP patch