From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reject incremental backups based on a backup from a divergent hi
Date: Tue, 03 Nov 2026 04:05:44 +0000
Message-ID: <E1xO5mK-00000001tDr-2sLw@gemulon.postgresql.org> (raw)
Reject incremental backups based on a backup from a divergent history
After a failover, an incremental backup could accept a prior backup
whose WAL range extends beyond the point where the new primary left the
old timeline. Combining these backups could retain pages from the
abandoned history, producing a corrupt backup that might still recover
and start successfully.
The validation checked the end of the prior backup's final WAL range
against the new backup's start LSN, but not against the timeline's
switch point. This allowed an incompatible prior backup to pass
validation once the new primary had advanced far enough.
Reject incremental backups if the prior backup's final WAL range
extends beyond the timeline's switch point.
Backpatch to v17, where incremental backup was introduced.
Author: Sai Pranav <rajasaipranav0@gmail.com>
Co-authored-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAPHduZC9pWm_vjznmhZNFsDZKLimqc6dKXOozLUKZVPs19zbZg@mail.gmail.com
Backpatch-through: 17
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/316861101e8c5ca48149d368e08ff865dd3ea306
Modified Files
--------------
doc/src/sgml/backup.sgml | 7 +++++++
src/backend/backup/basebackup_incremental.c | 13 +++++++++++++
src/bin/pg_combinebackup/t/008_promote.pl | 29 +++++++++++++++++++++++++++++
3 files changed, 49 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: fujii@postgresql.org
Subject: Re: pgsql: Reject incremental backups based on a backup from a divergent hi
In-Reply-To: <E1xO5mK-00000001tDr-2sLw@gemulon.postgresql.org>
References: <E1xO5mK-00000001tDr-2sLw@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox