postgresql/src
Jeff Davis d6a3dbe14f Fix theoretical torn page hazard.
The original report was concerned with a possible inconsistency
between the heap and the visibility map, which I was unable to
confirm. The concern has been retracted.

However, there did seem to be a torn page hazard when using
checksums. By not setting the heap page LSN during redo, the
protections of minRecoveryPoint were bypassed. Fixed, along with a
misleading comment.

It may have been impossible to hit this problem in practice, because
it would require a page tear between the checksum and the flags, so I
am marking this as a theoretical risk. But, as discussed, it did
violate expectations about the page LSN, so it may have other
consequences.

Backpatch to all supported versions.

Reported-by: Konstantin Knizhnik
Reviewed-by: Konstantin Knizhnik
Discussion: https://postgr.es/m/fed17dac-8cb8-4f5b-d462-1bb4908c029e@garret.ru
Backpatch-through: 11
2022-11-11 12:38:29 -08:00
..
backend Fix theoretical torn page hazard. 2022-11-11 12:38:29 -08:00
bin Support writing "CREATE/ALTER TABLE ... SET STORAGE DEFAULT". 2022-11-10 18:20:49 -05:00
common Introduce pg_pwrite_zeros() in fileutils.c 2022-11-08 12:23:46 +09:00
fe_utils meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
include Remove redundant declaration for XidInMVCCSnapshot 2022-11-09 18:30:09 +01:00
interfaces libpq: Reset singlerow flag correctly in pipeline mode 2022-10-14 19:06:26 +02:00
makefiles autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
pl Store GUC data in a memory context, instead of using malloc(). 2022-10-14 12:10:48 -04:00
port Provide sigaction() for Windows. 2022-11-09 13:06:31 +13:00
template Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
test Support writing "CREATE/ALTER TABLE ... SET STORAGE DEFAULT". 2022-11-10 18:20:49 -05:00
timezone Remove unneeded includes of <sys/stat.h> 2022-11-05 12:31:28 +09:00
tools Suppress useless wakeups in walreceiver. 2022-11-08 20:36:36 +13:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Make finding openssl program a configure or meson option 2022-10-20 21:05:42 +02:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00