TECHNOLOGY

PostgreSQL rejects incremental bases that extend into an abandoned timeline

In this article
THE QUICK TAKE

After failover, an earlier backup is not necessarily a valid incremental base; 18.7 rejects history extending beyond the timeline fork.

PostgreSQL 18.7 fixes acceptance of an incremental-backup base from divergent history after failover. A prior backup’s WAL range could extend beyond the point where the new primary left the old timeline. Combining it with the new history could retain pages from the abandoned branch and produce a corrupt backup. The repair makes backup ancestry a correctness condition rather than assuming that an earlier backup is automatically a valid base.

Chronological order does not establish ancestry

The release’s trigger is a WAL range crossing the new primary’s departure point from the old timeline. Two backups can have increasing timestamps while representing incompatible branches. A proposed qualification fixture retains the fork point, old backup range and new timeline explicitly. Testing only monotonically named artifacts would miss the relationship. The relevant comparison is whether the base’s history is compatible with the current branch, not whether its file was created first.

Retained old pages can invalidate the combination

The notes explain that combining divergent backups could retain pages from abandoned history. This is not merely a cosmetic timeline-label mismatch. A restore may then contain content that should not belong to the new primary’s branch. A proposed correctness oracle compares the restored database with controlled branch-specific changes. Archive parsing and successful transfer alone are insufficient because neither establishes that pages from the abandoned branch were excluded.

Rejection is the expected successful safeguard

For an incompatible base, qualification should expect refusal rather than demand that every incremental command complete. Automation must preserve that failure and choose a valid backup strategy instead of silently substituting an arbitrary older base. The release does not prescribe one universal orchestration workflow after rejection. A test can establish that the bad ancestry is refused, then separately verify a known-compatible base or a newly created full backup under the deployment’s chosen procedure.

Keep failover and backup inventories connected

Operational backup catalogs should retain enough timeline and range information to explain eligibility after failover. The patch provides validation in PostgreSQL, but clear metadata makes failures diagnosable and recovery planning reviewable. It does not retroactively repair old combined artifacts or prove every pre-update chain invalid. Record which chains were checked and which history they depend on. Backup age, retention status and ancestry are different attributes and should not be collapsed into one generic healthy flag.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles