public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Jialun Zhang <[email protected]>
Cc: [email protected]
Subject: Re: Why do we have checkPointCopy in ControlFileData?
Date: Fri, 03 Jul 2020 15:55:29 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAMFL+JjujGH6XbgDkvnRN5dVsMqYjjnN2k71vzcQE=0THFvEAA@mail.gmail.com>
References: <CAMFL+JjujGH6XbgDkvnRN5dVsMqYjjnN2k71vzcQE=0THFvEAA@mail.gmail.com>

Jialun Zhang <[email protected]> writes:
> I am reading the code about checkpoint, I think ControlFileData::checkPoint
> in pg_control.h is the last checkpoint, so why is there also a checkPointCopy?
> What is its role?

IIRC, checkPointCopy is the info about the preceding checkpoint.

I think the reason for it being there is an idea that if the latest
checkpoint record is corrupt, we could go back to the prior one and
replay forward from there.  I don't believe any such recovery method was
ever implemented (and it's fair to wonder if you'd have a consistent
database afterwards, anyway) but no one has bothered to remove the
field.

			regards, tom lane





view thread (2+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Why do we have checkPointCopy in ControlFileData?
  In-Reply-To: <[email protected]>

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

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