Re: Possible corruption by CreateRestartPoint at promotion
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: nathandbossart@gmail.com, pgsql-hackers@lists.postgresql.org, masao.fujii@oss.nttdata.com
Date: 2022-05-06T10:58:43Z
Lists: pgsql-hackers
Attachments
- v6-0001-Correctly-update-control-file-at-promotion.patch (text/x-diff) patch v6-0001
On Thu, Apr 28, 2022 at 03:49:42PM +0900, Michael Paquier wrote: > I am not sure what you mean here. FWIW, I am translating the > suggestion of Nathan to split the existing check in > CreateRestartPoint() that we are discussing here into two if blocks, > instead of just one: > - Move the update of checkPoint and checkPointCopy into its own if > block, controlled only by the check on > (ControlFile->checkPointCopy.redo < lastCheckPoint.redo) > - Keep the code updating minRecoveryPoint and minRecoveryPointTLI > mostly as-is, but just do the update when the control file state is > DB_IN_ARCHIVE_RECOVERY. Of course we need to keep the check on > (minRecoveryPoint < lastCheckPointEndPtr). And I have spent a bit of this stuff to finish with the attached. It will be a plus to get that done on HEAD for beta1, so I'll try to deal with it on Monday. I am still a bit stressed about the back branches as concurrent checkpoints are possible via CreateCheckPoint() from the startup process (not the case of HEAD), but the stable branches will have a new point release very soon so let's revisit this choice there later. v6 attached includes a TAP test, but I don't intend to include it as it is expensive. -- 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