Re: [WIP] Pipelined Recovery

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>
Cc: Imran Zaheer <imran(dot)zhir(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, assam258(at)gmail(dot)com, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [WIP] Pipelined Recovery
Date: 2026-08-17 13:20:08
Message-ID: CABPTF7V7LAZUe+MiheC7R_i_DnpX8LP5C2nveoxfTQE6GppZ=g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Nitin, Imran,

On Mon, Aug 17, 2026 at 8:08 PM Nitin Jadhav
<nitinjadhavpostgres(at)gmail(dot)com> wrote:
>
> Hi,
>
> +1 on the overall direction. Decoupling WAL decode from redo looks
> like a promising way to improve CPU-bound recovery, and the
> performance numbers are encouraging. Thanks for posting v6; I reviewed
> the series at a high level.
>
> My main concern is the startup-to-producer state handoff. Startup
> exports a broad recovery snapshot, but the producer appears to restore
> only part of it. That can leave the two sides operating with different
> views of the recovery state.
>
> This becomes more important because the state is spread across
> startup-local state, producer-local state, WalPipelineParams, and
> shared mutable state. In this model, correctness depends on a clear
> ownership contract for each field: who writes it, who reads it, when
> it may change, and which copy is authoritative if values diverge.
> Without that contract, it is difficult to reason about behavior under
> races.

I share the concern here. It might be simpler to make the startup
process the owner of recovery policy and make the producer a bounded,
policy-free WAL reader. It might not be viable to decouple them
cleanly since decoding is what discovers edege cases such as
incomplete WAL, missing continuation records, and read boundaries.
Still wondering whether those conditions can be reported to startup as
events rather than letting the producer making these policy decisions.

> Relatedly, it would help to document queue/replay invariants in one
> place: strict LSN ordering, no silent drop/skip, defined ordering
> between data and shutdown/error messages, and clear behavior on
> queue-full and early-exit paths. The consumer side in-place
> deserialization path also needs an explicit memory-lifetime guarantee,
> so pointer validity during redo is unambiguous.

--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-08-17 13:26:34 Re: Empty label expressions and views
Previous Message Peter Eisentraut 2026-08-17 13:18:02 Re: Vertex/Edge label and view