Re: Regarding Checkpoint Redo Record - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Regarding Checkpoint Redo Record
Date
Msg-id 4F0476C7.2040306@enterprisedb.com
Whole thread Raw
In response to Regarding Checkpoint Redo Record  (Amit Kapila <amit.kapila@huawei.com>)
Responses Re: Regarding Checkpoint Redo Record
List 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


pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Regarding Checkpoint Redo Record
Next
From: Simon Riggs
Date:
Subject: Re: Regarding Checkpoint Redo Record