Re: Why do we have checkPointCopy in ControlFileData?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why do we have checkPointCopy in ControlFileData?
Дата
Msg-id 1047047.1593806129@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Why do we have checkPointCopy in ControlFileData?  (Jialun Zhang <reatank@gmail.com>)
Список pgsql-novice
Jialun Zhang <reatank@gmail.com> 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



В списке pgsql-novice по дате отправления:

Предыдущее
От: Jialun Zhang
Дата:
Сообщение: Why do we have checkPointCopy in ControlFileData?
Следующее
От: Jialun Zhang
Дата:
Сообщение: What's the best practice to compare the transaction with the checkpoint?