Re: 9.2.3 crashes during archive recovery

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-13 19:19:01
Message-ID: 511BE725.8040207@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.02.2013 21:03, Tom Lane wrote:
> Simon Riggs<simon(at)2ndQuadrant(dot)com> writes:
>> On 13 February 2013 09:04, Heikki Linnakangas<hlinnakangas(at)vmware(dot)com> wrote:
>>> To be precise, we'd need to update the control file on every XLogFlush(),
>>> like we do during archive recovery. That would indeed be unacceptable from a
>>> performance point of view. Updating the control file that often would also
>>> be bad for robustness.
>
>> If those arguments make sense, then why don't they apply to recovery as well?
>
> In plain old crash recovery, don't the checks on whether to apply WAL
> records based on LSN take care of this?

The problem we're trying to solve is determining how much WAL needs to
be replayed until the database is consistent again. In crash recovery,
the answer is "all of it". That's why the CRC in the WAL is essential;
it's required to determine where the WAL ends. But if we had some other
mechanism, like if we updated minRecoveryPoint after every XLogFlush()
like Simon suggested, we wouldn't necessarily need the CRC to detect end
of WAL (not that I'd suggest removing it anyway), and we could throw an
error if there is corrupt bit somewhere in the WAL before the true end
of WAL.

In archive recovery, we can't just say "replay all the WAL", because the
whole idea of PITR is to not recover all the WAL. So we use
minRecoveryPoint to keep track of how far the WAL needs to be replayed
at a minimum, for the database to be consistent.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-02-13 19:21:42 Re: 9.2.3 crashes during archive recovery
Previous Message Heikki Linnakangas 2013-02-13 19:12:48 Re: 9.2.3 crashes during archive recovery