Re: Regarding Checkpoint Redo Record

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: 'PG Hackers' <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Regarding Checkpoint Redo Record
Date: 2012-01-04 15:56:55
Message-ID: 4F0476C7.2040306@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04.01.2012 08:42, Amit Kapila wrote:
> Why PostgreSQL needs to write WAL record for Checkpoint when it maintains
> same information in pg_control file?

I guess it wouldn't be strictly necessary...

> This may be required in case we need information about more than one
> checkpoint as pg_control can hold information of only recent checkpoint. But
> I could not think of a case where more than one checkpoint information will
> be required.

There is a pointer in the control file to the previous checkpoint, too.
It's not normally needed, but we fall back to that if the latest
checkpoint cannot be read for some reason, like disk failure. If you
have a disk failure and cannot read the latest checkpoint, chances are
that you have a corrupt database anyway, but at least we try to recover
as much as we can using the previous checkpoint.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-01-04 16:02:03 Re: Regarding Checkpoint Redo Record
Previous Message Simon Riggs 2012-01-04 15:13:05 Re: 16-bit page checksums for 9.2