Prevent restore of incremental backup from bloating VM fork.
commit : ffc226ab64d4ebdb089c278396d5df3d0a3f83b9
author : Robert Haas <rhaas@postgresql.org>
date : Mon, 9 Mar 2026 06:36:42 -0400
committer: Robert Haas <rhaas@postgresql.org>
date : Mon, 9 Mar 2026 06:36:42 -0400
Click here for diff
When I (rhaas) wrote the WAL summarizer code, I incorrectly believed
that XLOG_SMGR_TRUNCATE truncates all forks to the same length. In
fact, what other parts of the code do is compute the truncation length
for the FSM and VM forks from the truncation length used for the main
fork. But, because I was confused, I coded the WAL summarizer to set the
limit block for the VM fork to the same value as for the main fork.
(Incremental backup always copies FSM forks in full, so there is no
similar issue in that case.)
Doing that doesn't directly cause any data corruption, as far as I can
see. However, it does create a serious risk of consuming a large amount
of extra disk space, because pg_combinebackup's reconstruct.c believes
that the reconstructed file should always be at least as long as the
limit block value. We might want to be smarter about that at some point
in the future, because it's always safe to omit all-zeroes blocks at the
end of the last segment of a relation, and doing so could save disk
space, but the current algorithm will rarely waste enough disk space to
worry about unless we believe that a relation has been truncated to a
length much longer than its actual length on disk, which is exactly what
happens as a result of the problem mentioned in the previous paragraph.
To fix, create a new visibilitymap helper function and use it to include
the right limit block in the summary files. Incremental backups taken
with existing summary files will still have this issue, but this should
improve the situation going forward.
Diagnosed-by: Oleg Tkachenko <oatkachenko@gmail.com>
Diagnosed-by: Amul Sul <sulamul@gmail.com>
Discussion: http://postgr.es/m/CAAJ_b97PqG89hvPNJ8cGwmk94gJ9KOf_pLsowUyQGZgJY32o9g@mail.gmail.com
Discussion: http://postgr.es/m/6897DAF7-B699-41BF-A6FB-B818FCFFD585%40gmail.com
Backpatch-through: 17
M src/backend/access/heap/visibilitymap.c
M src/backend/postmaster/walsummarizer.c
M src/bin/pg_combinebackup/t/011_ib_truncation.pl
M src/include/access/visibilitymap.h
Stamp 14.22.
commit : 966473719c7f8067848dc79b58da0fb17ed136b1
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 17:03:30 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 17:03:30 -0500
Click here for diff
M configure
M configure.ac
Translation updates
commit : 7917762558545fbe16c0c9e9b97b83a30c11eaa8
author : Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 14:06:33 +0100
committer: Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 14:06:33 +0100
Click here for diff
Stamp 15.17.
commit : 3eb6f61958ac5027a18791a828a0c7a47accf211
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 17:01:47 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 17:01:47 -0500
Click here for diff
M configure
M configure.ac
Translation updates
commit : 7063b9e92b25caaa27c8cc4ec37ef85fe9e63cb7
author : Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 14:03:47 +0100
committer: Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 14:03:47 +0100
Click here for diff
Stamp 16.13.
commit : 776479eed63aac4185e57adaf7db1ce0810a4d3e
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 17:00:20 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 17:00:20 -0500
Click here for diff
M configure
M configure.ac
M meson.build
Translation updates
commit : 96802648aa2fc114f1d8728540494e422059b9ab
author : Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 14:02:22 +0100
committer: Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 14:02:22 +0100
Click here for diff
Stamp 17.9.
commit : 6d396980fc5aed4f1a525e0bd75cb16b25ed40ca
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 16:58:47 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 16:58:47 -0500
Click here for diff
M configure
M configure.ac
M meson.build
Translation updates
commit : 0546d90442f7226076d474045d3a287e20325fee
author : Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 13:56:36 +0100
committer: Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 13:56:36 +0100
Click here for diff
Stamp 18.3.
commit : 62d6c7d3df6287f1bd83199c1a746e50d31571a0
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 16:56:43 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 23 Feb 2026 16:56:43 -0500
Click here for diff
M configure
M configure.ac
M meson.build
Translation updates
commit : 1598d06b1490f7ed3a753c688620187403188ed9
author : Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 13:53:35 +0100
committer: Peter Eisentraut <peter@eisentraut.org>
date : Mon, 23 Feb 2026 13:53:35 +0100
Click here for diff
Stamp 14.21.
commit : eb788b43371849237c61ba2747fc11e96c08d861
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:57:12 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:57:12 -0500
Click here for diff
M configure
M configure.ac
Last-minute updates for release notes.
commit : 8771763bd97607882dd47925dceea0859a59ce97
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
Click here for diff
Stamp 15.16.
commit : 78bc85dd4455c302c345c550e0628a1522df108d
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:55:28 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:55:28 -0500
Click here for diff
M configure
M configure.ac
Last-minute updates for release notes.
commit : 749e616b7693cec9baaaf8744d740d436693ac91
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
Click here for diff
Stamp 16.12.
commit : e15d96551f9760e62888b5082ad050329c1c4cdf
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:53:53 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:53:53 -0500
Click here for diff
M configure
M configure.ac
M meson.build
Last-minute updates for release notes.
commit : 9889b3b64fe6bb52084159ae9bc5f2f5943fdd8a
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
Click here for diff
Stamp 17.8.
commit : 6af885119b52a2a6229959670ba3ae5e36bf9806
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:51:54 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 16:51:54 -0500
Click here for diff
M configure
M configure.ac
M meson.build
Last-minute updates for release notes.
commit : a3acb409025a2f8e2cb93346bbc1d87281f861fc
author : Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
committer: Tom Lane <tgl@sss.pgh.pa.us>
date : Mon, 9 Feb 2026 14:01:20 -0500
Click here for diff