]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix locking bugs that could corrupt pg_control.
authorThomas Munro <tmunro@postgresql.org>
Mon, 8 Jun 2020 01:57:24 +0000 (13:57 +1200)
committerThomas Munro <tmunro@postgresql.org>
Mon, 8 Jun 2020 02:01:51 +0000 (14:01 +1200)
commit644cac32a0bcfb1749e82c17f2d01d1b6aad8207
treebb05f5cd495e913e00246c84d759ac67f3732fb5
parent5c28a7bf1c57756e8992c2a6a083a34109f38323
Fix locking bugs that could corrupt pg_control.

The redo routines for XLOG_CHECKPOINT_{ONLINE,SHUTDOWN} must acquire
ControlFileLock before modifying ControlFile->checkPointCopy, or the
checkpointer could write out a control file with a bad checksum.

Likewise, XLogReportParameters() must acquire ControlFileLock before
modifying ControlFile and calling UpdateControlFile().

Back-patch to all supported releases.

Author: Nathan Bossart <bossartn@amazon.com>
Author: Fujii Masao <masao.fujii@oss.nttdata.com>
Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/70BF24D6-DC51-443F-B55A-95735803842A%40amazon.com
src/backend/access/transam/xlog.c