pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Florian Pflug <fgp@phlo.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Aidan Van Dyk <aidan@highrise.ca>
Cc: Linas Virbalas <linas.virbalas@continuent.com>
Cc: Euler Taveira de Oliveira <euler@timbira.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Hot Backup with rsync fails at pg_clog if under load
Date: Fri, 23 Sep 2011 19:58:30 +0300
Message-ID: <4E7CBAB6.6010205@enterprisedb.com> (raw)
In-Reply-To: <9C1909AF-D319-49BF-B3DA-5C3C30B5C849@phlo.org>
References: <CAA217BB.1E2F3%linas.virbalas@continuent.com>
	<4E7C4638.1060103@enterprisedb.com>
	<CAC_2qU-Km5FW9qXDEduv7K0S7tUTk==+tp=ZjdrFbpdbWZc-2w@mail.gmail.com>
	<CA+TgmoYoWD5HOk=__On2_LMe8qa6yn9dAtOuxzn54Wfgx+iVig@mail.gmail.com>
	<9C1909AF-D319-49BF-B3DA-5C3C30B5C849@phlo.org>

On 23.09.2011 19:49, Florian Pflug wrote:
> On Sep23, 2011, at 18:45 , Robert Haas wrote:
>> Ah.  I think you are right - Heikki made the same point.  Maybe some
>> of the stuff that happens just after this comment:
>>
>>         /*
>>          * Initialize for Hot Standby, if enabled. We won't let backends in
>>          * yet, not until we've reached the min recovery point specified in
>>          * control file and we've established a recovery snapshot from a
>>          * running-xacts WAL record.
>>          */
>>
>>
>> ...actually needs to be postponed until after we've reached consistency?
>
> I came the the same conclusion. It seems the before we've reached consistency,
> we shouldn't attempt to read anything because the data can be pretty arbitrarily
> garbled.

There are pretty clear rules on what state clog can be in. When you 
launch postmaster in a standby:

* Any clog preceding the nextXid from the checkpoint record we start 
recovery from, must either be valid, or the clog file must be missing 
altogether (which can happen when it was vacuumed away while the backup 
in progress - if the clog is still needed at the end of backup it must 
not be missing, of course).
* Any clog following nextXid can be garbled or missing.

Recovery will overwrite any clog after nextXid from the WAL, but not the 
clog before it.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (80+ messages)  latest in thread

Message-ID: <4E7CBAB6.6010205@enterprisedb.com>
Permalink:  ../4E7CBAB6.6010205@enterprisedb.com/
Also on:    postgresql.org/message-id/4E7CBAB6.6010205@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, fgp@phlo.org, robertmhaas@gmail.com, aidan@highrise.ca, linas.virbalas@continuent.com, euler@timbira.com
  Subject: Re: Hot Backup with rsync fails at pg_clog if under load
  In-Reply-To: <4E7CBAB6.6010205@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox