Re: race condition when writing pg_control
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Nathan Bossart <nathandbossart@gmail.com>,
Melanie Plageman <melanieplageman@gmail.com>,
Thomas Munro <thomas.munro@gmail.com>,
Michael Paquier <michael@paquier.xyz>,
Fujii Masao <masao.fujii@oss.nttdata.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-05-16T19:01:31Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > On 2024-05-16 14:50:50 -0400, Tom Lane wrote: >> The intention was certainly always that it be atomic. If it isn't >> we have got *big* trouble. > We unfortunately do *know* that on several systems e.g. basebackup can read a > partially written control file, while the control file is being > updated. Yeah, but can't we just retry that if we get a bad checksum? What had better be atomic is the write to disk. Systems that can't manage POSIX semantics for concurrent reads and writes are annoying, but not fatal ... regards, tom lane
Commits
-
Fix locking bugs that could corrupt pg_control.
- 09dc17486393 9.5.23 landed
- 644cac32a0bc 9.6.19 landed
- fd11b842eba9 10.14 landed
- 48eb6a3c895d 11.9 landed
- 72766ad6397a 12.4 landed
- acefa2cca6a2 13.0 landed
- 57cb8063089a 14.0 landed