1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-29 15:58:33 +03:00
Files
postgres/src
Michael Paquier a5ccf20801 Fix partial two-phase files left by crash during checkpoint
CheckPointTwoPhase() wrote each 2PC file in place, with O_TRUNC.  A
crash mid-write, or a base backup copying the file at that point left an
empty or partial file that would make startup fail, most likely on an
"incorrect size of file" ERROR.

The 2PC files are now written through a temporary file that gets renamed
at the end, relying on the atomicity of the rename to make startup safe,
be it after a crash or a base backup.

Author: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: David Steele <david@pgbackrest.org>
Discussion: https://postgr.es/m/CAGRkXqS_On-pLgcv6xjH8mvGhdcPmfWtythW3r8pYKUG+hsiuQ@mail.gmail.com
Backpatch-through: 14
2026-10-26 17:14:07 +09:00
..
2026-10-07 08:41:48 +02:00
2026-10-07 14:33:14 +02:00
…