Re: Timeline switching with partial WAL records can break replica recovery

From: Artem Gavrilov <artem(dot)gavrilov(at)percona(dot)com>
To: Alyona Vinter <dlaaren8(at)gmail(dot)com>
Cc: Nataliia <k(dot)natalissa(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Timeline switching with partial WAL records can break replica recovery
Date: 2025-12-25 15:11:15
Message-ID: CAFPkQKzfNOf-sHpYhj_UrzsdadC-P=9s7ipS6MY1-3qjeX177A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Alyona,

Your solution, if I understood it correctly, violates the main idea of
timelines, as it creates an "alternative" version for timeline N.
It's possible that primary finished contrecord and whole segment was
archived. Currently, replica always has subset of timeline N, so it's safe
to start new timeline from any point. But with your timeline finalization
logic it will create its own version timeline N that will conflict with
already archived version. If replica will archive timeline N+1 you may end
up with two different "tails" of timeline N in the same archive. Also I
assume some third party tools that rely on WAL may be broken by such change.

--

Artem Gavrilov

Senior Software Engineer, Percona

artem(dot)gavrilov(at)percona(dot)com
percona.com <http://www.percona.com>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2025-12-25 15:39:24 Re: index prefetching
Previous Message Андрей Казачков 2025-12-25 14:33:11 Re: [PATCH] Optionally record Plan IDs to track plan changes for a query