Re: Possible corruption by CreateRestartPoint at promotion

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: nathandbossart(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, masao(dot)fujii(at)oss(dot)nttdata(dot)com
Subject: Re: Possible corruption by CreateRestartPoint at promotion
Date: 2022-04-28 02:43:57
Message-ID: 20220428.114357.476887320744154615.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 28 Apr 2022 09:12:13 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in
> On Wed, Apr 27, 2022 at 11:09:45AM -0700, Nathan Bossart wrote:
> > On Wed, Apr 27, 2022 at 02:16:01PM +0900, Michael Paquier wrote:
> >> - if (ControlFile->state == DB_IN_ARCHIVE_RECOVERY &&
> >> - ControlFile->checkPointCopy.redo < lastCheckPoint.redo)
> >> - {
> >> 7ff23c6 has removed the last call to CreateCheckpoint() outside the
> >> checkpointer, meaning that there is one less concurrent race to worry
> >> about, but I have to admit that this change, to update the control
> >> file's checkPoint and checkPointCopy even if we don't check after
> >> ControlFile->checkPointCopy.redo < lastCheckPoint.redo would make the
> >> code less robust in ~14. So I am questioning whether a backpatch
> >> is actually worth the risk here.
> >
> > IMO we should still check this before updating ControlFile to be safe.
>
> Sure. Fine by me to play it safe.

Why do we consider concurrent check/restart points here while we don't
consider the same for ControlFile->checkPointCopy?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-04-28 02:50:26 Re: Possible corruption by CreateRestartPoint at promotion
Previous Message Kyotaro Horiguchi 2022-04-28 02:39:38 Re: Possible corruption by CreateRestartPoint at promotion