Re: Timeline switching with partial WAL records can break replica recovery
Artem Gavrilov <artem.gavrilov@percona.com>
From: Artem Gavrilov <artem.gavrilov@percona.com>
To: Alyona Vinter <dlaaren8@gmail.com>
Cc: Nataliia <k.natalissa@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-12-25T15:11:15Z
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.gavrilov@percona.com percona.com <http://www.percona.com>