Commit 57cb806
committed
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.com1 parent d094bf9 commit 57cb806
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9743 | 9743 | | |
9744 | 9744 | | |
9745 | 9745 | | |
| 9746 | + | |
| 9747 | + | |
9746 | 9748 | | |
9747 | 9749 | | |
9748 | 9750 | | |
| |||
9752 | 9754 | | |
9753 | 9755 | | |
9754 | 9756 | | |
| 9757 | + | |
| 9758 | + | |
9755 | 9759 | | |
9756 | 9760 | | |
9757 | 9761 | | |
| |||
9976 | 9980 | | |
9977 | 9981 | | |
9978 | 9982 | | |
| 9983 | + | |
9979 | 9984 | | |
| 9985 | + | |
9980 | 9986 | | |
9981 | 9987 | | |
9982 | 9988 | | |
| |||
10033 | 10039 | | |
10034 | 10040 | | |
10035 | 10041 | | |
| 10042 | + | |
10036 | 10043 | | |
| 10044 | + | |
10037 | 10045 | | |
10038 | 10046 | | |
10039 | 10047 | | |
| |||
0 commit comments