Re: Possible corruption by CreateRestartPoint at promotion
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-hackers@lists.postgresql.org, masao.fujii@oss.nttdata.com
Date: 2022-04-28T00:12:13Z
Lists: pgsql-hackers
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.
--
Michael
Commits
-
Fix control file update done in restartpoints still running after promotion
- 60e956eb825c 10.22 landed
- 4525151d4c2f 11.17 landed
- 7e59b1219109 12.12 landed
- 2e9559b30239 13.8 landed
- 6dced63b411b 14.4 landed
- 7863ee4def65 15.0 landed