Skip to content

Timeline-blind end-of-WAL marker can poison WAL restore after timeline switch #276

Description

@ardentperf

pkg/restorer.WALRestorer tracks end-of-WAL state with a single global spool marker named end-of-wal-stream. That marker is not scoped to the WAL timeline. This is unsafe when a restore flow uses parallel prefetch and PostgreSQL later requests WAL across a timeline switch. A prefetch miss on timeline N can set the global marker, and the next restore request on timeline N+1 can consume that marker before checking archive/spool state for the requested child-timeline segment.

A full repro is available here: https://github.com/ardentperf/bug-repro-wal-restore

The problem is not Barman core's normal behavior of returning failure when a requested WAL is unavailable. That is expected and is how PostgreSQL can move from archive restore to streaming, but it needs to be timeline scoped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions